in reply to Accessing nested elements
Given the structure you have, you should be able to access the nested elements with something like the following:
foreach my $file (keys %FilesHash) { foreach my $artist (keys %{$FilesHash{$file}}) { foreach my $album (keys %{$FilesHash{$file}{$artist}}) { foreach my $title (keys %{$FilesHash{$file}{$artist}{$albu +m}}) { print "File : $file\n"; print "Artist : $artist\n"; print "Album : $album\n"; print "Title : $title\n"; foreach my $attribute (keys %{$FilesHash{$file}{$artis +t}{$album}{$title}}) { printf("%-11s: %s\n", ucfirst($attribute), $FilesH +ash{$file}{$artist}{$album}{$title}{$attribute}); } } } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Accessing nested elements
by Anonymous Monk on Sep 29, 2009 at 08:00 UTC |