http://www.perlmonks.org?node_id=337214


in reply to Remove & from file

I'd recommend you try using the CGI module. When you create your CGI object, you just pass the query string to the constructor.

Do this, and you've got all the key/value pairs nicely split up and inside your CGI object, not to mention any URL-escaped characters have been converted. Get the keys using the param() method w/o an argument.