![]() |
|
Your skill will accomplish what the force of many cannot |
|
PerlMonks |
How do I decode or create those %-encodings on the web?by faq_monk (Initiate) |
on Oct 08, 1999 at 00:32 UTC ( [id://764]=perlfaq nodetype: print w/replies, xml ) | Need Help?? |
Current Perl documentation can be found at perldoc.perl.org. Here is our local, out-dated (pre-5.6) version: Here's an example of decoding:
$string = "<A HREF="http://altavista.digital.com/cgi-bin/query?pg=q&">http://altavista.digital.com/cgi-bin/query?pg=q&what=news&fmt=.&q=%2Bcgi-bin+%2Bperl.exe"; $string =~ s/%([a-fA-F0-9]{2})/chr(hex($1))/ge;
Encoding is a bit harder, because you can't just blindly change all the
non-alphanumunder character (
|
|