I am trying to parse command line options and values in my script. The script accepts 2 options: updategroup
or validategroup
. The updategroup
option should accept 2 values. For example:
./script.pl -updategroup 'group1' 'enable'
This is how I call GetOptions
:
GetOptions(\%args,"updategroup=s{2}","validategroup=s");
After calling it, I would like to store the 2 values in an array. How to fetch this value from the %args
hash variable?