This: 
if ($op == 0) {}
elsif ($op == 1) {}
elsif ($op == 2) {}
elsif ($op == 3) {}
elsif ($op == 4) {}
elsif ($op == 5) {}

is faster than this:

use Switch;
switch ($op) {
    case 0 { last }
    case 1 { last }
    case 2 { last }
    case 3 { last }
    case 4 { last }
    case 5 { last }
}

By a noticably amount. 


In a message dated 2/19/2004 5:47:47 PM Eastern Standard Time, 
[EMAIL PROTECTED] writes:
Switch allows coding that runs no more slowly than 'if'



-Will
-----------------------------------
Handy Yet Cryptic Code. 
Just to Look Cool to Look at and try to decipher without running it.

Windows
perl -e "printf qq.%3i\x20\x3d\x20\x27%c\x27\x09.,$_,$_ for 0x20..0x7e"

Unix
perl -e 'printf qq.%3i\x20\x3d\x20\x27%c\x27%7c.,$_,$_,0x20 for 0x20..0x7e'

Reply via email to