use warnings;
use strict;
use Text::CSV_XS;
use IO::File;
my $file = 'productsYourLenses.txt';
my $fh = new IO::File;
$fh->open("< $file") or die "Could not open $file";
my $csv = Text::CSV_XS->new({
'quote_char' => '',
'escape_char' => '',
'sep_char' => "\t",
'binary' => 1
});
my $columns;
while( 1 ){
$columns = $csv->getline($fh);
last unless @$columns;
print join '|', @$columns, "\n\n";
}
Or, for something this simple you could just use split.
use warnings;
use strict;
my $file = 'productsYourLenses.txt';
open my $fh, '<', $file or die "Could not open $file $!.\n";
my @rows;
while(<$fh>){
chomp;
s/\x00//g;
my @columns = split /\t+/;
push @rows, \@columns;
}
for (@rows){
print join '|', @$_, "\n\n";
}
Both of these will yield an AoA.
|