Chris Dolan schrieb:
On May 20, 2006, at 7:41 AM, Steffen Mueller wrote:
The is as follows:
*sigh* usage... :(
pp OPTIONS... @filename MORE_OPTIONS... @file2 OPTIONS...
The options from file 'filename' and 'file2' are inserted in the
corresponding places in @ARGV for processing with Getopt::Long as usual.
Unfortunately, this feature adds a new dependency: Getopt::ArgvFile.
What do you think? Should we accept the new dependency, hack up
something similar and inline it, or just not offer the feature at all?
I think it sounds like a fine feature. PAR has so many dependencies
that I'm sure few would complain about one more. :-) Nevertheless,
here's a simplistic implementation to pre-process the @ARGV list:
@ARGV = map {my $fh; /\A\@(.*)/ ? open($fh, "<", $1) ?
map {split} <$fh> : die $! : $_} @ARGV;
Yikes. Perl Golf :)
Fun aside, I would personally prefer a dependency over adding even more
hacks than there are in PAR already. No offense intended, but this
particular implementation wouldn't play well with quoted options.
I'm in favour of using the module even if it's just so that we can point
fingers if problems arise.
Steffen