in reply to Processing Complicated Command Line Options using Getopt

Thanks to everyone who has chimed in to help me out with this issue.

The nub of the issue, I gather, is that it is not possible to parse in an 'hash of arrays' using Getopt::Long directly.

From the replies, I believe there are two possible solutions:
1. Use a subroutine as the target of the command line option and do the parsing within that (as demonstrated by almut in his code example)
2. Use a string array as the target of the command line option and do further post processing

I dwelt upon this a bit, and with the helpful advice from JavaFan, I decided to use Getopt::Long with the s% specifier, such that the value parsed in from the options was a string (4 numbers separated by commas, within double quotes). Simple post processing was then applied and the values successfully placed into arrays for future use within the program.

Once again, Thanks to everyone who spared their time and efforts to help me out.
  • Comment on Re: Processing Complicated Command Line Options using Getopt