Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^2: Correct keys in hashes

by Aristotle (Chancellor)
on Aug 25, 2004 at 20:30 UTC ( #385811=note: print w/replies, xml ) Need Help??


in reply to Re: Correct keys in hashes
in thread Correct keys in hashes

That doesn't have anything to do with quoting keys. $foo{name} will always be interpreted as $foo{'name'}, and there's no way you can disambiguate that by using or not using quotes.

If that was supposed to call your name function, you should have written it with parens, as in $foo{name()}. In fact, you should get in the habit of never calling functions without parens. (And of using sub strictures.) That will disambiguate almost every case of possible confusion that crops up in Perl.

Makeshifts last the longest.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2022-05-20 13:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (73 votes). Check out past polls.

    Notices?