in reply to Urls & Perl

As FunkyMonk already pointed out, you need to escape the backslash in your regular expression. Otherwise \x2f is interpolated as the hex character 2F, which is "/".

You could easily make this translation generic if there are other characters that might be escaped.

my $str = 'https:\x2F\x2Fwww.google.com\x2Faccounts\x2FCheckCookie?cht +ml=LoginDoneHtml'; $str =~ s{\\x([0-9a-fA-F]{2})}{chr hex $1}eg; print $str;
- Miller

Replies are listed 'Best First'.
Re^2: Urls & Perl
by Anonymous Monk on Aug 12, 2007 at 07:46 UTC
    thank you very much. it worked great. but i dont know why its not working for: \u300d which should get converted to = thank you