Thanks for the suggestion and for the sample code.
For me I guess "clunky and difficult to manage" comes from the Camel book, pages 452-453 where, using getops you have something like:
my $debug = 0;
getopt('dlv');
if ($opt_d) {
$debug = 1;
}
if ($opt_l) {
# do something with arg l
}
if ($opt_v) {
# do something with arg v
}
To me that is not very managable. I can see from your code example and from the CPAN docs for Getopt::Long that this might actually be more workable for me.
I presume that I have to set some sort of option to be able to use "-d" rather than "-debug"?
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.