The equivalent code shows using what appears to me to be Perl's two-arg open. It's open(ARGV, $ARGV), and (consulting my fingers to double check) that seems to be, erm, two arguments. Yet you say you expect that particular one use of two-arg open to not be magical for just what reason?

If that were not the case then I'd expect an explicit notation that the normal two-arg open magicalness wasn't enabled since that would be different from the normal behavior of two-arg open anywhere else. As no expectation was given to the contrary, being shown that "This works like this snippet in which there's a two-arg open" leads to the reasonable expectation that filenames passed through this construct will behave just like filenames passed to two-arg open. Again, it's doing just what the diagram on the tin shows.

The same equivalent-for-<> code's been used back at least as far as the fourteen year old 4.0.36 manpage (back when all there was was two-arg open and you had to carry globrefs uphill both ways in the snow . . .) showing calling two-arg open identical to the code from the 2nd edition camel already shown.

To expect <>'s file opening not to behave as two-arg open and claim it's not documented as doing so doesn't match up.

And again: while I agree it would sane and safer to change the default, I can see why the no-backwards-compatibility-breaking-changes p5p decision was against removing 14+-year-old documented behavior.

At any rate we're way off into #386 territory here so . . .

The cake is a lie.
The cake is a lie.
The cake is a lie.


In reply to Re^7: magic-diamond <> behavior -- WHAT?! (dock) by Fletch
in thread magic-diamond <> behavior -- WHAT?! by repellent

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.