On 2012-08-20 00:18, John W. Krahn wrote:

print map exists $stud{ $_ } ? "$_ = $stud{ $_ }\n" : (), @names;

A map using a ternary with (), is like a grep:

  print "$_ = $stud{ $_ }\n" for grep exists $stud{ $_ }, @names;

--
Ruud


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to