Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to define a c-shell env variable in perl? 1

Status
Not open for further replies.

berndf

Technical User
Feb 13, 2001
1
US
Hi,

maybe someone is aware how to define
a c-shell environmet variable in a perl script.

e.g.

setenv QUERY "requestor = 'berndf'"

Thanks Bernd
 
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top