in reply to Pseudo-switch question
my($favorite_color) = ''; # get some kind of input here
print {
'red' => sub { 'the color is red.' }
'yellow' => sub { 'the color is yellow.' }
'blue' => sub { 'the color is blue.' }
'null' => sub { 'I do not know that color' }
}
->{ $favorite_color || 'null' }
-- Tommy Butler, a.k.a. TOMMY
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Pseudo-switch question
by Tommy (Chaplain) on Jul 23, 2003 at 05:22 UTC | |
|
Re^2: Pseudo-switch question
by Aristotle (Chancellor) on Jul 23, 2003 at 09:59 UTC |