in reply to Re^2: Default Hash Key
in thread Default Hash Key
use strict; use warnings; my %description = ( a => 'a vowel', b => 'a consonant', 0 => '0', default => 'not in the alphabet' ); for my $char (qw/a b c 0/) { my $d = $description{$char} || $description{default}; print("$char is $d\n"); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Default Hash Key
by EvanCarroll (Chaplain) on May 02, 2008 at 14:51 UTC | |
|
Re^4: Default Hash Key
by matze (Friar) on May 03, 2008 at 12:58 UTC | |
|
Re^4: Default Hash Key
by Anonymous Monk on May 04, 2008 at 17:10 UTC |