Spidy has asked for the wisdom of the Perl Monks concerning the following question:
And it's fast enough for me, but it has me wondering: is it faster to use elsif for this, or to just chain the statement into a whole pile of if statements?if($arg) { if($arg eq '1') { } elsif($arg eq '2') { } elsif($arg eq '3') { } } else { # error }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Regarding speed: Is elsif or just if faster?
by bart (Canon) on Feb 25, 2007 at 00:47 UTC | |
|
Re: Regarding speed: Is elsif or just if faster?
by davidj (Priest) on Feb 25, 2007 at 01:04 UTC | |
by blogical (Pilgrim) on Feb 25, 2007 at 03:16 UTC | |
|
Re: Regarding speed: Is elsif or just if faster?
by Joost (Canon) on Feb 25, 2007 at 02:38 UTC | |
|
Re: Regarding speed: Is elsif or just if faster?
by GrandFather (Saint) on Feb 25, 2007 at 00:50 UTC | |
|
Re: Regarding speed: Is elsif or just if faster?
by blazar (Canon) on Feb 25, 2007 at 11:24 UTC | |
|
Re: Regarding speed: Is elsif or just if faster?
by dwhite20899 (Friar) on Feb 25, 2007 at 01:02 UTC | |
|
Re: Regarding speed: Is elsif or just if faster?
by diotalevi (Canon) on Feb 25, 2007 at 00:47 UTC |