Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: getting called with interpreter arguments, not script arguments, not @ARGV

by thomas895 (Hermit)
on Jul 10, 2013 at 22:51 UTC ( #1043580=note: print w/ replies, xml ) Need Help??


in reply to getting called with interpreter arguments, not script arguments, not @ARGV

Why not just set scriptname.pl to executable(if not on Windows), and then pass the additional libs to load on the command line? The same applies to the include dirs.
For example, consider the following:

my @modules = split ",", $ARGV[0]; my @paths = split ":", $ARGV[1]; #change to ';' or other on Windows, + if needed push(@INC, @paths); $@ = undef; map { eval("require $_;") unless $@ } @modules; if($@) { die "one or more modules failed: $@"; } #rest of script
~Thomas~ 
"Excuse me for butting in, but I'm interrupt-driven..."


Comment on Re: getting called with interpreter arguments, not script arguments, not @ARGV
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (8)
As of 2014-08-23 18:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (176 votes), past polls