Re: [PBML] case/switch?
- ! Is there a case or switch statement in Perl as there is in C, Java,
! et al?
The short answer #1: No
Perl does not have a switch/case statement -- but it does have
several ways of accomplishing the same thing (or slightly
See the perlsyn manpage and the section entitled:
Basic BLOCKs and Switch Statements
Also see perlfaq7 for the heading:
How do I create a switch or case statement?
The short answer #2: Yes
Perl can now have an explicit switch statement provided via a module
(Switch.pm) by Damian Conway -- this is really a switch on steroids:
simple syntax, rich semantics. You can grab Switch.pm from your
nearest CPAN site.
Andrew L. Johnson http://members.home.net/perl-epwp/
A closed mouth gathers no foot.