Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^2: Using IF and OR, I'm sure there is a better way

by ikegami (Patriarch)
on Dec 21, 2005 at 18:05 UTC ( [id://518382] : note . print w/replies, xml ) Need Help??


in reply to Re: Using IF and OR, I'm sure there is a better way
in thread Using IF and OR, I'm sure there is a better way

Using $& can slow down regexps elsewhere in the program, so replace
print $& if ($variable=~/[123]/);
with
print $1 if ($variable=~/([123])/);