Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Hash of Hash of Listed subroutines

by Kanji (Parson)
on Jan 10, 2003 at 00:39 UTC ( [id://225697]=note: print w/replies, xml ) Need Help??


in reply to Hash of Hash of Listed subroutines

Something that stands out right off the bat is you want to loop over the keys not the entire hash, like so...

for my $key(keys %HoL) { &{$HoL{$key}[0]}; }

Also, you cannot embed subs inside strings without resorting to trickery, so instead you can one of the following ...

print "$key -> ", &{$HoL{$key}->{$i}}, "\n"; print "$key -> @{[ &{$HoL{$key}->{$i}} ]}\n"; # voodoo!

    --k.


Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2024-04-25 09:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found