develooper Front page | perl.perl5.porters | Postings from January 2012

[perl #33095] Misleading documentation for "while (<>)"

Thread Next
James E Keenan via RT
January 31, 2012 18:14
[perl #33095] Misleading documentation for "while (<>)"
Message ID:
On Fri Dec 17 17:57:00 2004, wrote:
> This is a bug report for perl from,
> generated with the help of perlbug 1.34 running under perl v5.8.0.
> [snip]
> Also, "magical" is not defined, and there is no way for a user to
> determine how to find out what this means.  In light of the first
> bug, the natural conclusion is that the unexpected behavior of
> "last" has something to do with ARGV's "magical" properties, but
> there's no way for the user to confirm or refute this guess.

Discussion in this ticket petered out seven years ago.  However, I think
the OP made, in passing, a valid point:  the meaning of "magic" or
"magical" is nowhere defined in 'perlop':

$ grep -inC1 magic pod/perlop.pod
163:The auto-increment operator has a little extra builtin magic to it.  If
164-you increment a variable that is numeric, or that has ever been used in
180:The auto-decrement operator is not magical.
898:The range operator also works on strings, using the magical
899-auto-increment, see below.
989:The range operator (in list context) makes use of the magical
990-auto-increment algorithm if the operands are strings.  You
1006:If the final value specified is not in the sequence that the magical
1007-increment would produce, the sequence goes until the next value would
1010:If the initial value specified isn't part of a magical increment
1011-sequence (that is, a non-empty string matching
1595-corresponding C</STRING/msixpodual> expression. The returned value is a
1596:normalized version of the original pattern. It magically differs from
1597-a string containing the same characters: C<ref(qr/x/)> returns
2897-internally. <> is just a synonym for <ARGV>, which
2898:is magical.  (The pseudo code above doesn't work because it treats
2899:<ARGV> as non-magical.)

How should this be rectified?

Thank you very much.
Jim Keenan

via perlbug:  queue: perl5 status: open

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About