Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Using multi-level hashes

by Zed_Lopez (Chaplain)
on Oct 28, 2005 at 21:32 UTC ( [id://503777]=note: print w/replies, xml ) Need Help??


in reply to Using multi-level hashes

$project{$activeProject}{components}{"Software"}{subComponents}{"Database"}{label} is syntactically equivalent to $project{$activeProject}->{components}->{"Software"}->{subComponents}->{"Database"}->{label}.

The $project hash's values are hashrefs. You can modify the values of those hashrefs within a subroutine.

my %h; $h{a}{b}{c} = 'd'; print "$h{a}{b}{c}\n"; f($h{a}{b}); print "$h{a}{b}{c}\n"; sub f { my $x = shift; $x->{c} = 'e'; }

produces

d e

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2024-04-24 20:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found