in reply to Replacing special characters from a URL

1nickt is right about using URI::Escape. So, you should do that. Also, this sounds a lot like an XY Problem, so why are you trying to do this? In any case, if you wanted to hand-roll a decoding for Percent encoding, you could do it with:
s/%([0-9a-f]{2})/chr hex $1/ieg;
Documentation: chr, hex, Modifiers from perlre.

Note that percent encoding is in hex, not decimal, so you probably want to include A-F in some way.


#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.