Dear all,

I try to read some records in one file. Each record
consists of several column which are separated by tab
and ends by "\n". What I would like to do is that to
build an array of array so that each record is a
reference to an anonymous array. 

the format in the file takes this format:
1


#!c:/Perl/bin/perl.exe

use warnings;
use strict;

use Data::Dumper;
my $file_name="data.txt";
open (FH,$file_name) or die " cant' open
$file_name$!";

my @AoA;

while (my $line=<FH>) {
        
        chomp $line;
        my @temp=split(/t/, $line);
        
        push @AoA, [EMAIL PROTECTED];
        
        }
print Data::Dumper->Dump([EMAIL PROTECTED]);

results:

$VAR1 = [
          '1    2       3'
        ];
$VAR2 = [
          '1    2       3'
        ];

 data:
 1      2       3
 1      2       3
 
 
 expect
 $VAR1 = [
          1,
          2,
          3,
        ];
$VAR2 = [
         1,
         2,
         3,
        ];


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to