$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; # cargo $todecode =~ s/%([0-9a-fA-F]{2})/pack("c",hex($1))/ge; # CGI