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}); } } } } }
In reply to Re: Accessing nested elements
by ig
in thread Accessing nested elements
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |