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"; }