Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Re^5: Dangerous diamonds! (Let's fix it)

by theorbtwo (Prior)
on May 19, 2003 at 20:53 UTC ( #259290=note: print w/replies, xml ) Need Help??

in reply to Re^4: Dangerous diamonds! (s/real/perfect/ world)
in thread Dangerous diamonds!

I think it's time to actualy fix this thing. I propose a new $^H (or %^H) hint that selects if ARGV magic open uses two-arg or three-arg open. What would matter is the value in effect at the moment of the open. I propose a pragmata to select it, and an additional "lock" feature, which would not allow changing the value after that point (in execution order, allowing it to be a feature of the module code, not the core).

IOW: use magic::ARGV qw(safe lock); allows you to trust all code from that point on. (use magic::ARGV qw(safe); wouldn't lock it in, so it could be explicitly overruled, use magic::ARGV qw(more-magic); would give back the old behaviour. All that's left is to get better names, perhaps change the default from more-magic to safe, and actualy code the thing.

Agree, disagree? Think I should be saying this on p5p already?

Warning: Unless otherwise stated, code is untested. Do not use without understanding. Code is posted in the hopes it is useful, but without warranty. All copyrights are relinquished into the public domain unless otherwise stated. I am not an angel. I am capable of error, and err on a fairly regular basis. If I made a mistake, please let me know (such as by replying to this node).

Replies are listed 'Best First'.
Re^6: Dangerous diamonds! (Let's fix it)
by tye (Sage) on May 19, 2003 at 21:06 UTC

    As I said, I've already started down that road. I've made similar changes and know what code is needed. However, I won't waste my time finishing it until someone can convince p5p to accept it. The amount of work is not trivial due to some accumulation of hacks in how 2-arg vs. 3-arg open are handled. And I'm convinced p5p won't accept such a patch anyway.

    I also refuse to try to convince p5p. I don't find them to be very susceptible to (my) logic. q-: (or, if you prefer, because it wouldn't work anyway -- someone else would have better luck convincing p5p)

    See my p5p submission for more details.

                    - tye

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2020-01-26 22:34 GMT
Find Nodes?
    Voting Booth?