in reply to Re: Help with complex data structures
in thread Help with complex data structures
Use a hash of array of hashes, so that we can remember more than one file per user:
# store the values push @{$files{$uid}}, { name => $name, size => $size, age => $age}; # use them foreach my $uid (keys %files) { print "$uid: files are:\n"; foreach my $file (@{$files{$uid}}) { print " $file->{name}\n"; } }
Updated: D'oh. Must remember to braces around the key when dereferencing $file->{name} (rather than $file->name)
--
Tommy
Too stupid to live.
Too stubborn to die.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Re: Help with complex data structures
by neilwatson (Priest) on Nov 14, 2002 at 16:33 UTC |