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?
Does that make sense?
Thank you in advance.
Is there a way to have a conditional equating to the keys of a hashref?
Without looping over the hashref.my $fields = { 'field1' => { 'maxlength' => 20, }, 'field2' => { 'maxlength' => 100, }, }; # something like this if ('field1' eq "key of $fields") { # do something }
Does that make sense?
Thank you in advance.
Back to
Seekers of Perl Wisdom