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

Only if you think unless is an operator? The second won't even compile.

Replies are listed 'Best First'.
Re^3: shift or die unless
by dsheroh (Monsignor) on Dec 03, 2008 at 22:30 UTC
    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".

      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