in reply to Re: Short or Long Hand
in thread Short or Long Hand

That won't quite work--you need parens.
print $day, $/ if $day !~ /^(?:0|6)$/;
or
print $day, $/ if $day !~ /^[06]$/;

Replies are listed 'Best First'.
Re^3: Short or Long Hand
by Dietz (Curate) on Aug 12, 2004 at 15:37 UTC
    It will work without parens as long as $day is a weekday field ranging 0..6
    Char class ( [06] ) is another good idea since it is faster then the alteration but you wouldn't determine the speed diff on a single digit.