Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

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]
[marto]: report problems to the appropriate place (see http://noc.perl. org for info)

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2018-02-20 12:27 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (271 votes). Check out past polls.