$age{"Jason"} = 23; $dad{"Jason"} = "Herbert";When you should do:
$people{"Jason"}{AGE} = 23; $people{"Jason"}{DAD} = "Herbert";Or even: (note use of
for
here)for $his ($people{"Jason"}) { $his->{AGE} = 23; $his->{DAD} = "Herbert"; }But think very carefully before writing this:
@{ $people{"Jason"} }{"AGE","DAD"} = (23, "Herbert");
Forward to Use $_ in Short Code
Back to Use Hashes for the First Time
Up to index
Copyright © 1998, Tom Christiansen
All rights reserved.