Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Re: Re: Dangerous diamonds!

by PodMaster (Abbot)
on May 18, 2003 at 16:09 UTC ( [id://258994]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Dangerous diamonds!
in thread Dangerous diamonds!

I'm surprised that Perl uses this way to open files with magic ARGV.
Why? This feature existed long before open had 3 arguments, why would it suddenly change.
It still cannot really fix the problem, since scripts will now die if they encounter an invalid file
There is no problem to fix. Sanitize your @ARGV if you insist on magic.


MJD says you can't just make shit up and expect the computer to know what you mean, retardo!
I run a Win32 PPM repository for perl 5.6x+5.8x. I take requests.
** The Third rule of perl club is a statement of fact: pod is sexy.

Replies are listed 'Best First'.
Re: Re: Re: Re: Dangerous diamonds!
by bart (Canon) on May 19, 2003 at 21:24 UTC
    I'm surprised that Perl uses this way to open files with magic ARGV.
    Why? This feature existed long before open had 3 arguments, why would it suddenly change.
    There's more than 2 and 3 argument open. There's also sysopen, which would behave properly, and which exists since 5.002, dating back to March 1996.

    And nobody in his right mind would expect the magic <> to be actually implemented in Perl. Do you? I think, not. C provides far less dangerous library functions.

      And nobody in his right mind would expect the magic <> to be actually implemented in Perl. Do you? I think, not. C provides far less dangerous library functions.
      Now that's just ridiculous. Larry and the perl 5 porters who wrote it expected it to behave that way, as would anyone who read the documentation.


      MJD says you can't just make shit up and expect the computer to know what you mean, retardo!
      I run a Win32 PPM repository for perl 5.6x+5.8x. I take requests.
      ** The Third rule of perl club is a statement of fact: pod is sexy.

        Larry and the perl 5 porters who wrote it expected it to behave that way, as would anyone who read the documentation.
        But is it the sane thing for it to do? I think not. Neither does any of the other opponents, I would think (tye, Juerd).

        The most sane thing to do would be to drop support for 2 argument open, putting mode and file path into one argument, completely.

Re: Re: Re: Re: Dangerous diamonds!
by Juerd (Abbot) on May 18, 2003 at 16:12 UTC

    Why? This feature existed long before open had 3 arguments, why would it suddenly change.

    I didn't think it would use normal perl open internally. Given that two-arg open enables command execution and that at that time only one- and two-arg open existed, I think it should have opened files by other means.

    But we live in a world that has three-arg open now. It's time to change, imo.

    Juerd # { site => 'juerd.nl', plp_site => 'plp.juerd.nl', do_not_use => 'spamtrap' }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://258994]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (5)
As of 2024-03-29 00:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found