Do you know where your variables are? | |
PerlMonks |
Re^4: Default Hash Keyby Anonymous Monk |
on May 04, 2008 at 17:10 UTC ( [id://684449]=note: print w/replies, xml ) | Need Help?? |
That problem is avoided in Perl 5.10.0 with
my $d = $description{$char} // $description{default}; # check for undefined rather than false
As for getting one's head around the logical or, it's really quite simple: $a || $b || $c || ... yields the first value that is true (or false if none are). Perl didn't invent it; it's a common operator in many languages, dating back to Snobol, I think.
In Section
Seekers of Perl Wisdom
|
|