Damian Conway has written a module that simulates a switch for Perl.
http://search.cpan.org/doc/DCONWAY/Switch-2.03/Switch.pm";>
SYNOPSIS
use Switch;
switch ($val) {
case 1 { print "number 1" }
case "a"{ print "string a" }
case [1..10,42] { print "number
--- Michael Fowler <[EMAIL PROTECTED]> wrote:
> On Tue, Jul 10, 2001 at 09:43:26AM -0400, Sparkle Williams wrote:
> > I'm having two problems
> > 1) Is there an equivalent of the case function in Perl?
>
> perldoc -q switch, or
Check out Damian Conway's Switch module.
http://search.cpan.org/doc
On Tue, Jul 10, 2001 at 09:43:26AM -0400, Sparkle Williams wrote:
> I'm having two problems
> 1) Is there an equivalent of the case function in Perl?
perldoc -q switch, or
http://www.perldoc.com/perl5.6/pod/perlfaq7.html#How%20do%20I%20create%20a%20switch%20or%20case%20statement%3f
> $ftp = Ne
Just got the answer to #1 for you: check out 'switch' - documented in the
'perlsyn' perldoc. There is no 'case' or 'switch' function, but you can
emulate it with a block & exit routine, as documented.
Jason
- Original Message -
From: "Sparkle Williams" <[EMAIL PROTECTED]>
To: <[EMAIL PR