http://qs321.pair.com?node_id=382295


in reply to Short or Long Hand

Why not just use a simple regex:

print $day, $/ if $day !~ /^0|6$/;

Add:
I made a common beginner mistake and I feel really ashamed about it.

Although above code will work on a single digit as it was demanded
( $day representing a weekday field from localtime() )
it is not logic as it says: don't match 0 at the beginning or don't match 6 at the end.

With nonmatching parens ( !~ /^(?:0|6)$/ ) it will satisfy the logic, still matching nondigits though. So it would've even been better written as !~ /0|6/ since the expected data is a single digit.

I'm so sorry!