To encode a string to be placed in a URL:
$string =~ s/([^A-Za-z0-9])/sprintf("%%%02X", ord($1))/seg;
To decode a URL-encoded string:
$string =~ s/\%([A-Fa-f0-9]{2})/pack('C', hex($1))/seg;
[ add comment ] ( 24026 views ) | permalink
Found this great Wiki on Bash Pitfalls today which should help avoid common bash scripting errors.
[ add comment ] ( 2636 views ) | permalink

Calendar


