in reply to Default Hash Key
Or the two-step approach:my $foo = exists($description{$input}) ? $description{$input} : "default value";
my $foo = $description{$input}; $foo = "default value" if (!defined($foo));
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Default Hash Key
by Anonymous Monk on Mar 13, 2012 at 13:44 UTC |