in reply to html code cleanup via GET

use URI::Escape; my $x = '%3Cb%3Eyo%3C%2Fb%3E'; print uri_unescape($x);
Boris

Replies are listed 'Best First'.
Re^2: html code cleanup via GET
by ecuguru (Monk) on Nov 02, 2004 at 19:54 UTC
    $string = "%3Cb%3Eyo%3C%2Fb%3E";\ $string =~ s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg;
    Worked!
    should I be using CGI.pm rather then the code I presented?

      Yes. No sense reinventing the wheel, especially incorrectly.

      $string = "%3Cb%3Eyo%3C%2Fb%3E"; $string =~ s/+/ /sg; <---- You forgot this. $string =~ s/%([0-9A-Fa-f]{2})/chr(hex($1))/seg;