20050207

perl switch code

People think there's no "switch" solution for perl:

for ($animal)
{
     /camel/ and do func(1), last;
     /llama/ and do func(2), last;
}

and you can actually search for a string in an array

grep /EXPR/, @array

0 Comments:

Post a Comment

<< Home