I think you missed his point, if not the point of the whole meditation. The behavior you cite from the docs did not exist in 5.004_04. The fact that it didn't could result in some obscure bugs. I pointed out two ways you could run into trouble because of it. And theorbtwo was trying to point out another one. (He was wrong, but only because setting $/ to a reference to a number in order to read fixed length records was not supported in 5.004_04.)

You can test if you need convincing and you have perl 5.004_04 ;-)

$ perl5.00404 -e '$/=\1; print "[$_]" while <>;' abcd 0000 ^D [abcd 0000 ]$
And if you need some evidence that the documentation you pasted is irrelevant to the case at hand:
$ perl5.00404 -we'$/="0"; print $l while ($l = <>)' Value of <HANDLE> construct can be "0"; test with defined() at -e line + 1. foo000bar foo0$

-sauoq
"My two cents aren't worth a dime.";

In reply to Re: Re: Re: To Kill a Meme: while(defined($line = <>)) by sauoq
in thread To Kill a Meme: while(defined($line = <>)) by sauoq

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.