in reply to Converting Column Into Row
Hi,
A better way is to create a hash containing your arrays as values (I put your input into a file named 'test'):
output:use Data::Dumper; my %h; open FH, "test"; while (<FH>) { chomp; next if /^\s*$/; split /=/; push @{$h{$_[0]}}, $_[1]; } close FH; print Dumper \%h;
$VAR1 = { 'A ' => [ ' 1', ' 2', ' 3' ], 'B ' => [ ' 5', ' 1', ' 7' ] };
Enjoy,
Mickey
|
---|
In Section
Seekers of Perl Wisdom