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
In reply to Re: Perl/Unix case
by davido
in thread Perl/Unix case
by Ronnie
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |