in reply to Command Line Regex

See URI::Escape for a safe and robust way to do that. Anyway, if you want that regex to work, you probably have to dig a bit perlop looking for the e modifier in the section about the substitution operator.

Flavio
perl -ple'$_=reverse' <<<ti.xittelop@oivalf

Don't fool yourself.

Replies are listed 'Best First'.
Re^2: Command Line Regex
by parv (Parson) on Apr 07, 2006 at 00:51 UTC

    Well, OP has almost what C<URI::Escape::uri_unescape()> does (after including C</e>). Only difference is that C<uri_unescape()> uses C<[0-9A-F]{2}>, which include 128 (UPDATE: 0xff - 0x7f; previously i wrote 72, calcualted very wrongly) extra characters. (For the pedantic, C<uri_unescape()> also differentiates the list context.)

      Only talking about a safe and robust way to do it. Using a function from a module (even your own module) is more readable and usually less error prone - like forgetting to put an e in the right place.

      PS: why the POD formatting instead of following Writeup Formatting Tips? Is there some functionality in PM that I missed?

      Flavio
      perl -ple'$_=reverse' <<<ti.xittelop@oivalf

      Don't fool yourself.

        The code in *uri_unescape()* method is no more robust or safe than what OP would have after fixing some errors. I grant you that if one is going to do the same work many times, one just may as well use the module.

        As to POD formatting, there is no more "functionality in PM" than you see.