While I agree that my code isn't the best, I tend to write switches like this (which I learned back in 1995, using perl 4)
SWITCH: for ($mystring) { /key1/ && do { … last SWITCH; }; /key2/ && do { … last SWITCH; }; /key3/ && do { … last SWITCH; }; # default … last SWITCH; }
In reply to Re: if or switch?
by Skeeve
in thread if or switch?
by gw1500se
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |