in reply to %20 results from reading info from a .dat file

How about :
$data =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg;

Replies are listed 'Best First'.
Re: Re: %20 results from reading info from a .dat file
by rob_au (Abbot) on Jan 14, 2002 at 05:28 UTC
    Cargo-cult programming at work here! How about shortening this to more simply ...

    $data =~ s/%([\da-fA-F]{2})/chr(hex($1))/eg;

     

    perl -e 's&&rob@cowsnet.com.au&&&split/[@.]/&&s&.com.&_&&&print'