I have several different machine architectures and OS (linux 2.4, linux 2.6, solaris, etc.). For each of those, I have several different builds of perl (with threads, without threads, with specific versions of modules, etc.).
I want to have a shell script which will act as a wrapper to choose the right perl version. I know how to figure out the OS and architecture automatically using uname and such. And I will pass special command line arguments to it in order to tell it that I want the threaded perl version or the non-threaded one. Etc.
But I'm getting into trouble.
Let's say the wrapper shell script is at "/usr/local/bin/perl_wrapper". I would really like to do something like this in my perl script:
#! /usr/local/bin/perl_wrapper print "Hello World!\n";
But that doesn't seem to work, because apparently "#!" needs to be followed by a compiled binary, not a shell script?
Okay, I can accept that. So I tried using "env" instead:
#! /usr/bin/env /usr/local/bin/perl_wrapper print "Hello World!\n";
Hey, that works! Great. Now let me just add that "-w" perl switch to it....
#! /usr/bin/env /usr/local/bin/perl_wrapper -w print "Hello World!\n";
Uh-oh! I get this error message:
/usr/bin/env: /usr/local/bin/perl_wrapper -w: No such file or direct +ory
It's like it's trying to find a file called "/usr/local/bin/perl_wrapper -w".
Okay, what do I do now? You can't pass command line arguments when you use /usr/bin/env?
Any help would be appreciated.
Thanks!
--- UPDATE: For some reason, my carriage return characters aren't showing up in the text above? Oy.
--- UPDATE 2: Okay, now it should be formatted better.
In reply to Perl wrapper by weigand
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |