Ok, I (now really having read the code) presume, that you
simply want to set the CGI-variable, don't you?
In this case, perldoc CGI tells:
the param() routine is used to set a CGI parameter
where $q is determined by the previously stated
$q = new CGI; # create new CGI object
So, your statement seems perfectly right. The only clue
is, that you "call it from another Perl script". In this
case you have to export/import variables, haven't you?
If so, wait for another PerlMonk to answer this, because
I am not experienced with exchanging variables between