Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

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.

Replies are listed 'Best First'.
Re^2: The default hash - accident, coincidence or conspiracy?
by SimonClinch (Deacon) 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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://468294]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (11)
As of 2017-11-21 15:55 GMT
Find Nodes?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:

    Results (304 votes). Check out past polls.