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.
- Millermy $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;
In reply to Re: Urls & Perl
by wind
in thread Urls & Perl
by user2000
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |