in reply to Re: WHILE and DEFINED problem
in thread WHILE and DEFINED problem

OIC, now it's clear. Yes, you're right, Have just verified everything out. chomp does return a value of 1 by default for every <> read-in. It actually ties with the contents $/. ICIC! Thanks again, Thelonius!

Replies are listed 'Best First'.
Re: Re: Re: WHILE and DEFINED problem
by Thelonius (Priest) on Mar 05, 2004 at 16:16 UTC
    One further note of caution. If you use while(chomp($a = <>)), then your loop will not process the last line of the file if it is incomplete (i.e. if it is missing the final newline). It is common on DOS and Windows for the last line to be incomplete.

    It is safer to put the chomp inside the body of the loop.