in reply to Interpretation of a line needed.
Create a list of key value pairs from the given list where the keys are each element of the list and values are undefmap { $_ => undef } qw(Name Phone)
Populate an anonymous hash with the list that was created from the map{ map { $_ => undef } qw(Name Phone) }
Check for the existence of $field in the anonymous hash reference.exists { map { $_ => undef } qw(Name Phone) } -> { $field };
Perl Idioms Explained - keys %{{map{$_=>1}@list}} may also be of help.
HTH
_________
broquaint
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Interpretation of a line needed.
by Anonymous Monk on Sep 23, 2003 at 16:32 UTC |