[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Testing for Defined



Christian Brechbuehler wrote:
> 
> MacPerl complained to Richard Gordon:
> > # Value of <HANDLE> construct can be "0"; test with defined().
> 
> 
> Excerpt of message (sent 19 January 1999) by David Turley:
> > while (defined($the_input = <INPUT>)){
> > 
> > This makes sure your while loop won't end prematurly if a line in
> > <INPUT> contains only '0'.
> 
> 
> You must set $/="0" to make this happen, or is there another way?
> 

It can happen with any value for $/:

{input record separator}0{EOF}


Ronald

***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch