Probably this is not better and it's not what you want.
Take it as an alternative ;-)

It's an Array of Hashes.
It gets the column headers from the first row of __DATA__.
When you have fixed length columns 'unpack' is a good choice.
For this example I'm not using __END__ at the end of __DATA__ :-)

##################################################################

my (@AoH, @headers);
while (<DATA>) {
        my %temp;
        my @temp = unpack("A24 A7 A11 A11 A11 A10 A6", $_ );
        $_ =~s/^\s+// foreach @temp;
        if ( [EMAIL PROTECTED] ) {
                @headers = @temp
        } else {
                $temp{$headers[$_]} = $temp[$_] for ( 0 .. $#temp);
                push @AoH, \%temp;
        }
}

# To get the 'big picture':
use Data::Dumper;
print Dumper [EMAIL PROTECTED];

# To get some elements from the first row:
print $AoH[0]->{'table'} , " : npdata = " , $AoH[0]->{'npdata'} ,
" AND npused = " , $AoH[0]->{'npused'} , "\n";

# Will print: table01 : npdata = 1653131 AND npused = 1653542

##################################################################

Have fun!

-- 
::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::                                                    ::
::   Simplicidade.com                                 ::
::   Consultoria em Tecnologias de Informação, Lda.   ::
::                                                    ::
::   Rua António Onofre, 4D                           ::
::   2870-220 Montijo - PORTUGAL                      ::
::                                                    ::
::   Tel./Fax: +351 21 231 01 51                      ::
::                                                    ::
::   [EMAIL PROTECTED]                            ::
::   http://www.simplicidade.com                      ::
::                                                    ::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::

Attachment: pgp2ASWcFvnCy.pgp
Description: PGP signature

Reply via email to