% perl -le '
use Getopt::Long;
use Hash::Util qw(lock_keys);
lock_keys %Opt, qw(mrg);
GetOptions(\%Opt, "mrg=i") or die;
if ($Opt{mgr}){
print "INT=$Opt{mrg}";
}
'
Attempt to access disallowed key 'mgr' in a restricted hash at -e line 6.
An example that combines with Pod::Usage:
http://repo.or.cz/cpan-testers-parsereport.git/blob/HEAD:/bin/ctgetreports
That said, I think it's an important enough feature that this module should be bundled with Perl, so that people relying on fields.pm (which was first released with Perl 5.5) and Hash::Util (Perl 5.8) won't need to install anything extra.
]]>