Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

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

by thomas895 (Deacon)
on Jul 10, 2013 at 22:51 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1043580]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2024-04-24 05:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found