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...
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.