pianogirl95 has asked for the wisdom of the Perl Monks concerning the following question:
I ended up just preserving $1 inside are var before the switch. I've never had a problem using Switch, and for this code (sorry, can't post it) I have a several nested if's inside of each case. I'll test it again and see if removing the switch improves performance.switch ($val) { case /^\s*(\S+)$/{ print "$1\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Switch and $1?
by Corion (Patriarch) on Jun 14, 2005 at 21:11 UTC | |
|
Re: Switch and $1?
by jeffa (Bishop) on Jun 14, 2005 at 21:19 UTC | |
|
Re: Switch and $1?
by ikegami (Patriarch) on Jun 14, 2005 at 21:32 UTC |