in reply to Updating scripts from late 90's

The snippet fails badly if a poorly encoded URL is provided.
$value =~ s/%([A-Fa-f0-9]{2})/pack("c",hex($1))/ge;
is much more resilliant. Actually, you should be using CGI instead of home grown alternatives to avoid bugs and problems like this one.