in reply to (Ovid) Re: Re: Parsing multi-line records
in thread Parsing multi-line records

or just take it into an LDIF-like datastructure:
my $recordSet = 11; open FILE, "< $file" or die "Cannot open $file for reading: $!"; chomp ( my @list = <FILE> ); close FILE; my @datasets = (); while (my @subList = splice( @list, 0, $recordSet) ){ my %hash = (); foreach (@subList){ my ($key, $value) = split(/\s*\:\s*/, $_, 2); if (exists $hash{$key} ){ push (@{ $hash{$key} }, $value); } else { $hash{$key} = $value; } push @datasets, \%hash; # if unique key exists, better use a Hash of Hashes # instead of array of hashes } } }