in reply to Perl/Unix case
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Perl/Unix case
by thor (Priest) on Oct 23, 2004 at 04:29 UTC |