Subject: | Optional hash-valued option warns when key is missing, even though the key is not required |
Minimal test case of Getopt::Long v2.50 on perl 5.26.1, Cygwin x64:
$ perl -MGetopt::Long -E 'my %o; GetOptions(\%o, "v:s%")' -- -v
Use of uninitialized value $key in anonymous hash ({}) at .../perl-5.26.1/lib/site_perl/5.26.1/Getopt/Long.pm line 659.
The specification `:s%`, permitting optional hash values, is rather strange. However, suppose someone typed it instead of `=s%` by accident! I would expect $o{v} == {} in that case, without the "uninitialized-value" message. If you have opportunity, would you be willing to look at this? Thank you!