Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re: Debugging Regexes

by skyknight (Hermit)
on Jun 29, 2004 at 12:46 UTC ( #370462=note: print w/replies, xml ) Need Help??

in reply to Debugging Regexes

Personally, I think that the way you wrote that statement is evil and such constructs should be avoided. I really shouldn't have to think too hard about operator evaluation order to figure out how your code works. You could have at least put parentheses around the operands of the &&. As the code presently exists, I'd have to run it through a debugger to convince myself that it works the way you claim it works.

Maybe this is an extreme opinion, but I think I'd prefer that compilers/interpreters forced you to parenthesize for stuff like that, and threw ambiguity errors when you didn't.

Replies are listed 'Best First'.
Re^2: Debugging Regexes
by Jasper (Chaplain) on Jun 29, 2004 at 16:18 UTC
    yer.. the OP should have used something like:
     print /foo/ ? 'bar' : 'baz'

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://370462]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (2)
As of 2018-05-28 00:18 GMT
Find Nodes?
    Voting Booth?