Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

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).


Comment on Re^5: Dangerous diamonds! (Let's fix it)
Select or Download Code
Re^6: Dangerous diamonds! (Let's fix it)
by tye (Cardinal) 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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (12)
As of 2014-09-22 13:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (192 votes), past polls