|Perl Monk, Perl Meditation|
Arrays and GetOpt::Longby aijin (Monk)
|on Jul 04, 2001 at 22:49 UTC||Need Help??|
aijin has asked for the
wisdom of the Perl Monks concerning the following question:
I'm working on a fairly complicated (for me) collection of code and I would really love for one of the scripts to be able to take a list as one of it's arguments.
The problem is, I've no idea how to make this work both for the user accessing this script from the shell (which is highly likely), and for the scripts that will be calling it. It's easy enough to pass a reference to an array to another script being run, but that's not exactly something that a user will be able to do.
Just for reference, the list is a number of queries that the user wants to run through the program, so it's not a case of trying to stack all my options into an array. I have no advance knowledge of what these queries might be, either. Don't panic, though. They don't get eval'd.
I've been asked to keep my code consistent with the other developers, and they all use Getopt::Long to pull in comand line options, so that's what I'm stuck with.
So, does anyone out there have any suggestions how I can get lists as input through Getopt::Long in the command line and when being run by another script?
-aijin, probably missing something obvious...