Help for this page

Select Code to Download


  1. or download this
    use strict;
    use URI::Escape:
    ...
    
    my $res = get("http://www.foo.com?data=".uri_escape("12 34+56")); #sen
    +t as: data=12%2034%2B12, both space and "+" are escaped.
    my $res2 = get("http://www.foo.com?data=12 34+56")); # sent as: date=1
    +2%2034+56, i.e. space is escaped, but "+" is not.
    
  2. or download this
    # in URI::_init(C:/Perl/site/lib/URI.pm:76):
      $str =~ s/([^$uric\#])/$URI::Escape::escapes{$1}/go;
    # where $uric is:
    # \;\/\?\:\@\&\=\+\$\,\[\]A-Za-z0-9\-_\.\!\~\*\'\(\)%
    
  3. or download this
        $text =~ s/([^A-Za-z0-9\-_.!~*'()])/$escapes{$1}/g;