Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^5: Is this the most elegant way to code directory lookup?

by Hue-Bond (Priest)
on Sep 29, 2006 at 17:20 UTC ( [id://575577]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Is this the most elegant way to code directory lookup?
in thread Is this the most elegant way to code directory lookup?

An overly complex conditional is an overly complex conditional regardless of whether it appears as part of an if statement or an unless statement.

I think I should've formulated the question in other words: "Quick, when will we enter into the block?".

  • if ($bar !~ /bar/ and ($baz =~ /qux/ or not defined $undef)): If this doesn't match that, and at least one of the other conditions.
  • unless ($bar =~ /bar/ or ($baz !~ /qux/ and defined $undef)): Err, well... applying DeMorgan... err... when there's no match... and...

Or, put it yet another way: if we know the values of $bar, $baz, and $undef, is it easier to walk the if or the unless conditional?

--
David Serrano

  • Comment on Re^5: Is this the most elegant way to code directory lookup?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (2)
As of 2024-04-26 07:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found