in reply to Decoding part of URL

You are right -- all those codes do correspond to the ASCII table. Very clever!! IE, yes it will work in all cases where the characters are part of the ascii table, which as moritz indicates is not all characters.

"use CGI" is generally the way to go tho. I've used this before, when I didn't want to use a module:
sub CGI_convert { my @lut33 = ('!', '"', '#', '$', '%', '&', "'", '(', ')', '*', + '+', ',', '-', '.', '/'); my @lut58 = (':', ';', '<', '=', '>', '?', '@'); my @lut91 = ('[', '\\', ']', '^', '_', '`'); my @lut123 = ('{', '|', '}', '~'); my $flag = 0; my $string = pop; if ($string =~ /^%/) { $flag=1 } my @ray = split /%/,$string; foreach my $e (@ray) { unless ($flag) { $flag=1; next }; my $dsym = hex(substr($e,0,2)); my $symbol = undef; if (($dsym<48) && ($dsym>32)) { $dsym-=33; $symbol=$lu +t33[$dsym]; } if (($dsym<65) && ($dsym>57)) { $dsym-=58; $symbol=$lu +t58[$dsym]; } if (($dsym<97) && ($dsym>90)) { $dsym-=91; $symbol=$lu +t91[$dsym]; } if (($dsym<127) && ($dsym>122)) { $dsym-=123; $symbol= +$lut123[$dsym]; } unless (defined $symbol) { next }; substr($e,0,2)=$symbol; } return join "",@ray; }
But Your formulation is considerably less long winded. Nice.