Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re^2: Short or Long Hand

by Eimi Metamorphoumai (Deacon)
on Aug 12, 2004 at 15:30 UTC ( #382302=note: print w/replies, xml ) Need Help??

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)$/;
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.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://382302]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2016-10-23 02:43 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (300 votes). Check out past polls.