I have an HTML page which is dynamically built from a search using cgi/perl. There are several products on the page and each product has a reference. There is an HREF link from each product which passes the product code preceded by a "?" (for example, the href link is /cgi-bin/proddets.cgi?ABCDE"). How do I pick up the code in the cgi/perl program? It's not in any of the $ENV areas that I can find.

It should be in $ENV{QUERY_STRING}. Here are some of the ENV variables along with a query string.

If you are going to write CGI's with Perl I would highly recommend you use the standard library for CGI's,CGI.pm. It provides methods for retrieving the query string along with a lot more helpful things.

Thanks for the reply Borderline. I was using the QUERY_STRING variable but it was always empty. After a lot of debugging and messing about I discovered my problem was caused by the product codes beginning with the hash (#) symbol - once I removed the # then everything worked just fine.