The environment is kept in a hash in perl, so it would be:
$ENV{QUERY}="requestor='berndf'"
That will do it. It won't, however, set it for the rest of your session, it only sets it in the environment for the perl script, I believe. A perl script runs as a different process from it's parent, so a child changing env vars does not affect the parent.
so, it's
$ENV{VARIABLE_NAME}= "value"
As always, I hope that helped!
Disclaimer:
Beware: Studies have shown that research causes cancer in lab rats.