in reply to Re: Passing a required script arguments
in thread Passing a required script arguments
As you well know, when you require a file, the code in the file is executed. Given that, what's "wrong with [his] perception of how Perl works"? Sounds to me like he just wants to wrap an existing script that uses @ARGV and that's perfectly doable as long as the script doesn't explicitly exit or die. He can do preprocessing on @ARGV as well as additional processing after the require'd code...
echo 'sub foo { print for @ARGV } foo(); 1;' > foo.pl perl -le 'require "foo.pl"; foo()' bar baz
Not that I'd argue such a thing is wise, but it is doable and therefore thinking it is doable doesn't indicate a flawed understanding of how Perl works.
-sauoq "My two cents aren't worth a dime.";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Passing a required script arguments
by Abigail-II (Bishop) on Sep 26, 2003 at 16:16 UTC | |
by sauoq (Abbot) on Sep 26, 2003 at 17:07 UTC | |
by bart (Canon) on Sep 27, 2003 at 00:02 UTC | |
|