You can potentially use the Options function with hash values . "
For example, I wanted to allow users to set arbitrary filters when analyzing an array of objects.
GetOptions(my $options = {}, 'foo=s', 'filter=s%') my $filters = $options->{filter};
And then call it like
perl ./script.pl --foo bar --filter baz=qux --filter hail=eris
To build something like ..
$options = { 'filter' => { 'hail' => 'eris', 'baz' => 'qux' }, 'foo' => 'bar' };
And of course, $ filters will have a value associated with 'filter'
Good luck Hope someone found this helpful.
source share