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 (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 lurking in the Monastery: (11)
As of 2014-07-31 15:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (249 votes), past polls