Hi Everyone,
I have a file: a.txt
a,b,c,d,6,6,6
1,2,3,d,6,6,6
4,5,6,6,6,6,6
#!/usr/bin/perl
use warnings;
use strict;
my @array = ();
### Load file into array
for my $i (split '\n', `cat /tmp/a.txt`) {
push @array, [ split ',', $i ];
}
It works. But my a.txt have 1million lines, and each lines have 17 fields. If use 'cat' like above, it takes veeeeeeeeeery long time.
How to do it using open?, especially need to split ',' for each line.
Thanks