Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Modifying %ENV From The Shebang Line

by philcrow (Priest)
on Dec 17, 2007 at 22:27 UTC ( #657534=note: print w/replies, xml ) Need Help??


in reply to Modifying %ENV From The Shebang Line

Could you use a dummy script to launch the actual one?
#!/bin/bash export envar=value /path/to/actual/perl/script
Phil
The Gantry Web Framework Book is now available.

Replies are listed 'Best First'.
Re^2: Modifying %ENV From The Shebang Line
by williams (Beadle) on Dec 17, 2007 at 22:41 UTC
    That was also one of the solutions I posted. It does indeed work, but it seems crufty. For every Perl hook script I write, I've got to write a shell layer to kick it off. The layers could probably be symbolic links to a common script. If that's the best I can do, I can live with it. I just thought there was a better way, given the sneaky shebangs in perlrun.

    Thanks,

    Jim

      One environment-fixing wrapper, as shown, but taking an argument that specifies which perl hook script to be run.
      #!/bin/bash export LD_LIBRARY_PATH=... export HOOKS_PATH=/path/to/svn/hooks [ -f $HOOKS_PATH/$1 ] && perl $HOOKS_PATH/$1

      --
      [ e d @ h a l l e y . c c ]

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://657534]
help
Chatterbox?
[1nickt]: Corion I assume you are talking about Retry? Attempt doesn;t offer callbacks and has a much simpler interface. (Also written by someone I trust...)
[perldigious]: I train for long portaging/rowing trips by carrying my kayak to the river about a half mile from my house 2-3 times a week depending on weather... but due to a lingering winter, I haven't had long to train this year.
[erix]: Ah, I found the link for my run: 6km (and 6km back)
[perldigious]: Also, made the unhappy discovery that the ticks have become active already this year... I really, really hate ticks.

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (12)
As of 2017-05-24 13:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?