use IO::File; use Text::CSV_XS; my $csv = Text::CSV_XS->new({ sep_char=>'|' }); my $io = IO::File->new('myfile.piped.txt', '<') or die "Can't read file: $!\n"; until ($io->eof) { my $row = $csv->getline($io); # read and parse line into an ARRAYref print "Second field says: ", $row->[1], "\n"; }