Opps, forgot to change the variable name. Ah the power of cut and paste...
for my $row ( keys %tracks ) {
$artist = $tracks{$row}->{artist};
$title = $tracks{$row}->{title};
}
> I wrote:
>
> Excellent! Thanks! So, when I need to iterate through the hash of
> hashes and
> work on the data would I do this:
>
> for my $row ( keys %tracks ) {
> $artist = $tracks{$fname}->{artist};
> $title = $tracks{$fname}->{title};
> }
>
> Thanks again for the pointer,
> Patrick
>
> > Gary Stainburn wrote:
> >
> > Surely, a hash of hashes would be better then.
> >
> > my %tracks=(); # create empty hash
> >
> > Then to populate the data you do something like:
> >
> > $tracks{$fname}->{artist}=$artist;
> > $tracks{$fname}->{title}=$title;
> >
> > Gary
> >
> > On Tuesday 01 May 2001 4:08 pm, J. Patrick Lanigan wrote:
> > > Overall what I am trying to accomplish is to loop through a bunch of
> > > mp3 files and extract the ID3 Tag Info into a hash (%tracks) for
> > > which each key references the filename, filepath, artist, album,
> > > tracknum, title, genre for one file. Once I have %tracks populated I
> > > need to iterate through it and INSERT the info into a PostgreSQL DB.
> > > I am completely open to any other suggestion for a way to collect a
> > > dataset with a unique identifier. I've got all the other code
> > > working, this is the last piece to my puzzel.
> > >
> > > Thanks,
> > > Patrick