# Gleefully ripped from the CGI.pm escape method. $STRING =~ s/([^a-zA-Z0-9_.-])/lc sprintf(".%02x", ord($1))/eg; # Originally #$toencode =~ s/([^a-zA-Z0-9_.-])/uc sprintf("%%%02x", ord($1))/eg;