in reply to Regular Confuscion

Hi Imagist,

It's not getting rid of special characters, it's converting text containing hexadecimal values the corresponding bytes, if the text (either $value or $name) contains a "%" symbol, followed by 1 or more hexadecimal digits.

Read up on regular expressions, and you'll see that the /e switch at the end has the effect of doing an eval on the replacement text.

Also, take a look at the hex function.


s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/

Replies are listed 'Best First'.
Re^2: Regular Confuscion
by Imagist (Initiate) on Jan 31, 2007 at 20:20 UTC
    Oh, I see. I was wading though the perl documentation on the "pack" function and couldn't see the forest for the trees when I was trying to understand this code. Thanks for the explanation.