Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re: Assignment of hash to hash doesn't work?

by hdb (Prior)
on May 13, 2014 at 13:30 UTC ( #1085898=note: print w/replies, xml ) Need Help??

in reply to Assignment of hash to hash doesn't work?

In addition to what the fellow brothers said above, $recordset_TA_SITE[0]{'Age'} only works because Perl is secretly interpreting it as $recordset_TA_SITE[0]->{'Age'}. This happens only for nested structures (more precisely: from the second level onwards) and therefore $site{'Age'} is not automatically interpreted as $site->{'Age'}.

Replies are listed 'Best First'.
Re^2: Assignment of hash to hash doesn't work?
by CountZero (Bishop) on May 13, 2014 at 13:49 UTC
    Or more easy to remember: Perl assumes a '->' between closing and opening square and curly brackets.


    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

    My blog: Imperial Deltronics

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2016-10-28 02:34 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (374 votes). Check out past polls.