in reply to Default Hash Key

You could always do something like:
my $foo = exists($description{$input}) ? $description{$input} : "default value";
Or the two-step approach:
my $foo = $description{$input}; $foo = "default value" if (!defined($foo));
--
Wade

Replies are listed 'Best First'.
Re^2: Default Hash Key
by Anonymous Monk on Mar 13, 2012 at 13:44 UTC

    Using the "//" operator, this folds into:

    my $foo = $description{$input} // "default value";