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.";
In reply to Re: Re: Passing a required script arguments
by sauoq
in thread Passing a required script arguments
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |