sub alt_uri_escape { my ($text) = @_; $text =~ s/([^A-Za-z0-9\-_.!~*'()])/sprintf "%%%02x", ord $1/ge; return $text; }