http://qs321.pair.com?node_id=172784

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi, Basically I want to check a value in one hash and only set a new entry in another hash if its defined in the first i.e.
if ( $hash1->{'a'}->{'b'}->{'c'} ) { $hash2->{'bob'} = $hash1->{'a'}->{'b'}->{'c'}; }
But it strikes me that there must be a more efficient(perlish) way than hitting $hash1 twice? Any views would stop me wasting a lot of time pondering... Cheers Mar

Edit kudra, 2002-06-08 Changed title