in reply to Style, *again*

  Taint mode *only* for setuid programs

Alas, many exploits start with a wiley h4x0r getting their foot in the door.

  Logical order in comparisons: $foo == 4, but never 4 == $foo

The latter form is occassionaly useful to quickly signal to the reader that we're interested in array size, not array contents. I.e.,

foo(@stuff) unless 0 == @stuff;
It is, however, a matter of style.

Replies are listed 'Best First'.
Re: Re: Style, *again*
by demerphq (Chancellor) on Apr 12, 2003 at 18:02 UTC

    The latter form is occassionaly useful to quickly signal to the reader that we're interested in array size, not array contents

    That doesnt only apply to arrays. When comparing against literals I find using the literal on the left can make for more readable code, as it can emphasise the important part of the conditional. Just like the way it can be more readable to use $_ when doing a lot of regex work on one string. I also find an added advantage of putting the literal first in numeric context is that it avoids the problem of occasionally using "=" instead of "==", which gets caught as an attempt to assign to a read only value instead of (sometimes silently!) overwriting the variable.


    ---
    demerphq

    <Elian> And I do take a kind of perverse pleasure in having an OO assembly language...