in reply to Perl Hashes

Maybe something like this?

#!/usr/bin/perl use strict; use warnings; my $Filename = $ARGV[0]; my $limit = 0; my $x = 0; my %individualHash = (); open (DATA, "< $Filename") or die "..."; my $headline = <DATA>; chomp $headline; my @headlineNew = split(';',$headline); my @headHash; while (<DATA>) { my @save=split(';',$_); chomp @save; $limit = @save; for ($x = 0; $x<$limit; $x+=1) { $individualHash{"$headlineNew[$x]"} = $save[$x]; print STDERR "HASH KEY\tValue: $headlineNew[$x]\t$indi +vidualHash{$headlineNew[$x]}\n"; } push(@headHash, %individualHash); %individualHash = (); }

-Michael

Replies are listed 'Best First'.
Re^2: Perl Hashes
by Horst (Initiate) on Jul 12, 2013 at 23:37 UTC
    Thank u