in reply to How to open an URL with variable in CGI?

Remove the first & from the query string; that character separates key=value pairs and you have nothing in front of it.

Your $1 is not being evaluated because it is inside single quotes.

Also, where do you set $1? It's usually set by Perl as a regex capture...

Update: got back to PC; improved formatting

The way forward always starts with a minimal test.