in reply to Will Perl 6 abbreviate this indirection for me?
In the above code, map will create a list of space stripped hash references based on each element of the required fields, and foreach will then take each element of the generated list and test if there is an undef value in the list (which of cause means missing).foreach (map{StripLTSpace($href->{$_})}@required_fields) { print "Error!\n" if ($_ eq undef); }
|
|---|