in reply to This is why Perl is so frustrating

If you wish to verify that "x" is neither one of two possibilities, then you have to verify that "x" is not "." and "x" is not "..".

so ... what you want is

if (($file ne ".") and ($file ne "..")) { ...

Best, beth

  • Comment on Re: This is why logic is so frustrating (was This is why Perl is so frustrating)
  • Download Code

Replies are listed 'Best First'.
Re^2: This is why logic is so frustrating (was This is why Perl is so frustrating)
by eggmatters (Initiate) on Jul 29, 2009 at 18:17 UTC
    Yes, I remember this all from school and my c programming days. True or False is always true unelss the bit flips due to cosmic background radiation or the butterfly effect:
    http://xkcd.com/378/

      Another annoying possibility is interrupts/concurrency. I once had a case where

      if ($x && !$x) {...}
      was evaluating to true, two or three times per hour.