in reply to hash problems

For another way to do it, skip the hash and: $string =~ s/%([0-9][A-Z0-9])/chr(hex($!))/eg; Now that I look at it, you specify hex values, but you match A-Z, not just A-F. Is this intentional?