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

Re: [MacPerl] File Handle Error in New MacPerl



Richard Rathe <rrathe@dean.med.ufl.edu> writes:
>On 1/1/98 Brian L. Matthews wrote:
>>Unless the last line in the file doesn't end in a newline. If the last
>>two characters in the file are "\n0", while ($line = <IMAGES>) will skip
>>the zero.
>
>To summarize, if the last char is a 0 on a line by itself (however we
>define a line)

*AND* that line is missing its newline character.
> then $line = <F> will miss this single character, but
>otherwise behave normally.
>
>Correct?

Yes.

>Just out of curiosity, is that a printable zero or a NULL (ASCII 00) we're
>talking about?

Printable. By the way, there is a further subtlety in that only the 

if ($x = <>)

form is at risk here. The 

if (<>)

form automatically uses a defined() test.

>PS: The LACK of a warning may have been a bug with an earlier version of
>MacPerl. The only thing I changed was going from 5.1.3r2 to 5.1.6r4.

That was not a "bug", but one of the many new warnings introduced in 
perl 5.004. As the "r" version hints at, 5.1.3 was based on perl 5.002.

Matthias

-----
Matthias Neeracher   <neeri@iis.ee.ethz.ch>   http://www.iis.ee.ethz.ch/~neeri
   "I'm set free to find a new illusion" -- Velvet Underground

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