in reply to Re: Can this If/Else be condensed into a 1 liner with a trailing If?
in thread Can this If/Else be condensed into a 1 liner with a trailing If?

Isn't exactly the same as: in perl 5.005 and above?

I remember a time when they *weren't* the same, but I'm pretty sure that they are now.

-Blake

Replies are listed 'Best First'.
Re: Re: Re: Can this If/Else be condensed into a 1 liner with a trailing If?
by pjf (Curate) on Oct 02, 2001 at 08:17 UTC
    Well spotted, and quite correct. When dealing with numbers I tend to step to a higher level of paranoia, simply because zero is a number, but it's not true. This paranoia occasionally wears off onto the code around it. ;)

    Cheers,
    Paul

      Actually, whithin a while (<STDIN>) {...}, the $_ contains the trailing \n. So even though a line might contain a lone zero, it will indeed be "0\n", which is definitely true.

      --bwana147

        But a textfile could be malformed and missing the \n at the end of the last line (most Windows text editors forget to put a \n at the end of the last line) thus $_ could contain "0"