in reply to Re^2: shift or die unless
in thread shift or die unless

It wasn't meant to be runnable code, just to indicate logical grouping.

More verbosely: It is not immediately obvious whether that line means "check the date of the file and, if it's less than a week old, shift or die" or "if shift returns a false value and the file is less than a week old, then die".

Replies are listed 'Best First'.
Re^4: shift or die unless
by ikegami (Patriarch) on Dec 04, 2008 at 12:16 UTC
    If it's not runnable code, the logical grouping is impossible.

      It would seem that you are arguing that any code that executes as expected is okay. I believe the point wasn't that the code was ambiguios to perl but rather to the programmer maintaining it. Yes it only does one thing and does it correctly and logicaly, however that doesn't mean that the way its phrased doesn't leave a programmer with some room for confusion.


      ___________
      Eric Hodges

        Mine was a rather ineloquent reply. No, whether it executes is not is not relevant to my argument. If you read back to my original reply, you'll see that was just an aside.

        To presume ambitiousness presumes the existence of a maintainer that doesn't know the very fundamentals of the language. Statements are Perl's building blocks. It's no coincidence that they are the first thing in the documentation. They are to expressions what parens are to subexpressions. Someone confused by them won't understand the rest of the statement anyway.