Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
8
Task/URL-decoding/Perl/url-decoding-1.pl
Normal file
8
Task/URL-decoding/Perl/url-decoding-1.pl
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
sub urldecode {
|
||||
my $s = shift;
|
||||
$s =~ tr/\+/ /;
|
||||
$s =~ s/\%([A-Fa-f0-9]{2})/pack('C', hex($1))/eg;
|
||||
return $s;
|
||||
}
|
||||
|
||||
print urldecode('http%3A%2F%2Ffoo+bar%2F')."\n";
|
||||
7
Task/URL-decoding/Perl/url-decoding-2.pl
Normal file
7
Task/URL-decoding/Perl/url-decoding-2.pl
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
#!/usr/bin/perl -w
|
||||
use strict ;
|
||||
use URI::Escape ;
|
||||
|
||||
my $encoded = "http%3A%2F%2Ffoo%20bar%2F" ;
|
||||
my $unencoded = uri_unescape( $encoded ) ;
|
||||
print "The unencoded string is $unencoded !\n" ;
|
||||
Loading…
Add table
Add a link
Reference in a new issue