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.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Something eq hashref key
by haukex (Archbishop) on Mar 25, 2019 at 13:44 UTC | |
by LanX (Saint) on Mar 25, 2019 at 14:06 UTC | |
by hdb (Monsignor) on Mar 25, 2019 at 14:17 UTC | |
by LanX (Saint) on Mar 25, 2019 at 14:59 UTC | |
by Anonymous Monk on Mar 25, 2019 at 13:51 UTC |
Back to
Seekers of Perl Wisdom