in reply to Character conversion
You can convert the other way using this line of code
The reverse of what you do in your first regexp, which also could be simplified just a tiny bit like so$str =~ s/([^A-Za-z0-9])/sprintf("%%%02X", ord($1))/seg;
$str =~ s/\%([A-Fa-f0-9]{2})/pack('C', hex($1))/seg;
_____________________
"We've all heard that a million monkeys banging on a million typewriters will eventually reproduce
the entire works of Shakespeare. Now, thanks to the Internet, we know this is not true." - Robert Wilensky, University of California
"We've all heard that a million monkeys banging on a million typewriters will eventually reproduce
the entire works of Shakespeare. Now, thanks to the Internet, we know this is not true." - Robert Wilensky, University of California
|
---|
In Section
Seekers of Perl Wisdom