http://www.perlmonks.org?node_id=1231655

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

Is there a way to have a conditional equating to the keys of a hashref?
my $fields = { 'field1' => { 'maxlength' => 20, }, 'field2' => { 'maxlength' => 100, }, }; # something like this if ('field1' eq "key of $fields") { # do something }
Without looping over the hashref.

Does that make sense?

Thank you in advance.