Perl unfortuantly doesn't have a case statement but, as with most things, TMTOW to roll your own.
The simplest, obviously, is with a set of if...elsif...else statements which does essentially the same thing if looking a little less elegant.
The hash is another possibility and maybe faster than the if... route (but don't quote me on that), although unless you have lots of options then the difference is probably going to be negligable.
All code is untested unless otherwise stated.
In reply to Re: Perl/Unix case
by gothic_mallard
in thread Perl/Unix case
by Ronnie
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |