Using $& can slow down regexps elsewhere in the program, so replace
print $& if ($variable=~/[123]/);
with
print $1 if ($variable=~/([123])/);
In reply to Re^2: Using IF and OR, I'm sure there is a better way
by ikegami
in thread Using IF and OR, I'm sure there is a better way
by cosmicperl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |