Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: How to set (environment) variables for the script

by Skeeve (Vicar)
on Jun 10, 2010 at 14:58 UTC ( #844016=note: print w/ replies, xml ) Need Help??


in reply to How to set (environment) variables for the script

This gave me the cleanest solution, I guess: perldoc perlrun

My script starts now like this:

#!/bin/sh mydir=`dirname $0` . $mydir/set_env.sh exec perl -x $0 "$@" #!perl use strict; use warnings; # and so on...

Thanks to all who replied!

Update: In reply to Arge1 below and because I noticed today That I myself needed parameters to my script.

I appended "$@" to my exec above. This will append all parameters, individually quoted, to the exec command for my perl script to handle them.


s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%
+.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`$''`"e


Comment on Re: How to set (environment) variables for the script
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://844016]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (9)
As of 2014-12-20 17:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (97 votes), past polls