All of which is completely in keeping with my assertion that this was an accident of implementation. I see nothing here that says "intentional" over "accidental".

emulate the behavior of sed and awk
...
or from each file listed on the command line
...
The ARGV array is then processed as a list of filenames.
...
put the current filename into variable ARGV
...
as you leave the first filename at the beginning of the array

I'm pretty sure running sed or awk against 'rm -rf .. |' doesn't blow away your directory.

Thanks for the proof that for over 2 decades the intent of the feature was repeatedly documented to be non-magical, despite the implementation, the copy of the implementation in the documentation, and the documentation completely overlooking the "magical" problem.

The documentation talks a lot about the intent. In all of that talking, the intent is always described as "filename"s and there was no mention of an intent at "magical" behavior.

The lazy implementation uses "-" to get STDIN and the note that this thwarts the "obvious" addition of "<" to get safer behavior may be part of why the implementation didn't include such.

- tye        


In reply to Re^11: magic-diamond <> behavior -- WHAT?! (intent) by tye
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.