4 my @letters = split(//,shift);
5 my @safe = ('a' .. 'z', 'A' .. 'Z', '0' .. '9', '-', '_', '.', '!', '~', '*', "'", '(', ')');
6 foreach my $letter (@letters) {
7 my $pattern = quotemeta($letter);
8 if (not grep(/$pattern/, @safe)) {
9 $letter = sprintf("%%%02x", ord($letter));
12 return join('', @letters);
15 print UrlEncode
(join(' ', @ARGV)), "\n";