in reply to Re^2: Loading of Complex Data Structures
in thread Loading of Complex Data Structures

The following code will do what you want:
#!/usr/bin/perl use Data::Dumper; my %HoA = (); my %hash_track = (); while(<DATA>) { chomp($_); my (@stuff) = split(" ", $_); &fill(@stuff); } print Dumper(\%HoA); sub fill() { my @a = @_; my @ar = @a[0,1,2,4,5,6,7]; my $h = $a[3]; $HoA{$h}[$hash_track{$h}] = [ @ar ]; $hash_track{$h}++; } __DATA__ 334 Capped 28 5034366 16777215 NULL NULL NULL 373 Capped 28 5034366 16777215 NULL NULL NULL
output:
$VAR1 = { '5034366' => [ [ '334', 'Capped', '28', '16777215', 'NULL', 'NULL', 'NULL' ], [ '373', 'Capped', '28', '16777215', 'NULL', 'NULL', 'NULL' ] ] };

%hash_track is used to increment the first level %HoA array.

hope this helps,

davidj

Replies are listed 'Best First'.
Re^4: Loading of Complex Data Structures
by davidj (Priest) on Aug 25, 2004 at 21:25 UTC
    the above is mine. For some reason I entered it as Anonymous. Silly me

    davidj