in reply to Re: How to load a + into a string
in thread How to load a + into a string

Thanks Perlbotics. Yes sorry I forgot to mention that it was via HTTP and once I changed it to %2B it worked perfectly. Also helped me work out a few other bugs in the code. Thanks again.

Replies are listed 'Best First'.
Re^3: How to load a + into a string
by Anonymous Monk on Jun 16, 2014 at 22:02 UTC

    Are you sending it via a HTTP GET parameter? The "cleaner" way to do that would be with something like URI:

    use URI; my $uri = URI->new("http://www.foo.com/bar"); $uri->query_form( param_one => "hello+world&foo=bar", param_two => "blah" ); print "$uri\n"; # prints "http://www.foo.com/bar?param_one=hello%2Bworld%26foo%3Dbar&p +aram_two=blah"