in reply to Perl/Unix case
Perl doesn't have a built-in switch construct. But there are many ways to accomplish it. The hashtable you mentioned is one of them. Here's another:
SWITCH: { ($condition) && do { # stuff; last SWITCH; }; ($condition2) && do { # something else; last SWITCH; }; die "Neither condition was met.\n"; }
This is discussed in perlsyn, I believe.
Dave
|
|---|