if ( /%[0-9A-Fa-f]{2}/ ) { # 1. # my $escaped = uri_unescape( $_ ); same effect as the RE but slower s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg; # 2. my $s = decode_utf8( $_ ); # 3. $s = encode("iso-8859-1", $s); push @new_words, $s; } else { push @new_words, $_; }