Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9103101
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T01:33:03+00:00 2026-06-17T01:33:03+00:00

I’m trying to identify the differences between the two strings during a URL get

  • 0

I’m trying to identify the differences between the two strings during a URL get request (using LWP::Simple).
I have a URL, say http://www.example.com?param1=x&param2=y&param3=z
I make sure any blank inputs are also taken care of, but that is irrelevant at this point, because I am making sure all parameters are exactly the same.
Also, the hard-coded URL is copied and pasted from the generated URL.
This URL works when I do the following:

my $url = "http://www.example.com?param1=x&param2=y&param3=z";
my $content = get($url);

Yet, when I build the URL from parameters provided by a user, the get request does not work (Error: 500 from the site).
I have compared the two URLs by printing them out, and see zero differences. I’ve tried removing all of the potential invisible characters.

The output for the generated code and static string, assuming user input is the same as the static string (which is what I’m making sure to do):

http://www.example.com?param1=x&param2=y&param3=z
http://www.example.com?param1=x¶m2=y¶m3=z

I’m assuming printing the outputs removes characters I can’t see.
I’ve also followed a solution at http://www.perlmonks.org/?node_id=882590 and it is pointing out differences, but I don’t know why, considering I see none at all.
Has anyone run into this problem before? Please let me know if I need to clarify anything or need to provide additional information.

EDIT: Problem and Solution
So, after using mob’s suggestion to identify differences, I found there was a null character in the generated URL that was not getting printed in the output. That is:
http://www.example.com?param1=x&param2=y&param3=z was actually
http://www.example.com?param1=x&param2=y&param3=\000z.
I used a simple regex: $url =~ s/\000//g; to remove that (and any other) null value.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T01:33:05+00:00Added an answer on June 17, 2026 at 1:33 am

    Use a data serialization function to inspect your strings for hidden characters.

    $url1 = "http://www.example.com?param1=x&param2=y";
    $url2 = "http://www.example.com?param1=x&param2=y\0";
    $url3 = "http://www.example.com?param1=x&param2=y\n";
    
    use JSON;
    print JSON->new->pretty(1)->encode( [$url1,$url2,$url3] );
    # Result:
    # [
    #   "http://www.example.com?param1=x&param2=y",
    #   "http://www.example.com?param1=x&param2=y\u0000",
    #   "http://www.example.com?param1=x&param2=y\n"
    # ]
    
    
    use Data::Dumper;
    $Data::Dumper::Useqq = 1;
    print Dumper($url1,$url2,$url3);
    # Result:
    # $VAR1 = "http://www.example.com?param1=x&param2=y";
    # $VAR2 = "http://www.example.com?param1=x&param2=y\0";
    # $VAR3 = "http://www.example.com?param1=x&param2=y\n";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I am trying to find ID3V2 tags from MP3 file using jid3lib in Java.
I have just tried to save a simple *.rtf file with some websites and
I have thousands of HTML files to process using Groovy/Java and I need to
I have a view passing on information from a database: def serve_article(request, id): served_article
I am trying to loop through a bunch of documents I have to put
I'm making a simple page using Google Maps API 3. My first. One marker
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I am trying to understand how to use SyndicationItem to display feed which is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.