Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Need help with hashes please!!!

by Masem (Monsignor)
on Jan 27, 2002 at 05:12 UTC ( #141861=note: print w/ replies, xml ) Need Help??


in reply to Need help with hashes please!!!

In your line:

foreach $sedolelement (keys $tradedatehash{$tradedatemarker}) {
the element $tradedatehash{$tradedatemarker} is going to be a hash reference, not a hash directly. This is because perl stores complex structures as references as opposed to direct storage (see perlref for more details). To convert this hashref to a hash variable that keys can use, you can 'dereference' it by surrounding the variable with %{ }, as in:
foreach $sedolelement ( keys %{ $tradedatehash{ $tradedatemarker } } ) + { ... }
(Similarly, array references are deref'ed with @{ }, if you need this)

-----------------------------------------------------
Dr. Michael K. Neylon - mneylon-pm@masemware.com || "You've left the lens cap of your mind on again, Pinky" - The Brain
"I can see my house from here!"
It's not what you know, but knowing how to find it if you don't know that's important


Comment on Re: Need help with hashes please!!!
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (13)
As of 2015-07-07 11:47 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 (88 votes), past polls