Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

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

by thomas895 (Chaplain)
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 fog begins to lift...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2017-06-27 02:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (598 votes). Check out past polls.