Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: The default hash - accident, coincidence or conspiracy?

by Animator (Hermit)
on Jun 20, 2005 at 12:03 UTC ( #468294=note: print w/ replies, xml ) Need Help??


in reply to The default hash - accident, coincidence or conspiracy?

The question should not be 'will it be supported', the question should be: 'do you want to use it'?

It's a real global variable, it lives in the main/default symbol table, you can not lexicalize it, and more important, every file and package can modify it.

Especially the last point will make it hard to maintain and/or modify and/or integrate it with other programs.

This is ofcourse all true for $_ and @_, but do you really rely on them having a certain value? I certainly do not.

Also note that there is no point to have a 'default' hash. You can create a package-global hash (%config for example) which you can access from other packages by including the package name. And if you are not happy with that then you can even import it in other packages.


Comment on Re: The default hash - accident, coincidence or conspiracy?
Select or Download Code
Re^2: The default hash - accident, coincidence or conspiracy?
by SimonClinch (Chaplain) on Jun 20, 2005 at 12:18 UTC
    Thank you all for such prompt response -- already Animator's point about it being open to modification by any module has persuaded me (sigh) not to use it - pity in a way - it looked so inviting. (-S)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (13)
As of 2015-07-07 15:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (90 votes), past polls