1 | These are generalized tr like functions which convert a list to a string (pack) or string to list/array (unpack) according to a template |
2 | We can illustrate with a fragment from a CGI script that reads and interprets data sent to a server in the peculiar application/x-www-form-urlencoded coding scheme |
3 | $value =~ tr/+/ /; # Convert + back to blanks |
4 | $value =~ /%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))//eg; |