#!/usr/bin/env perl use strict; use warnings; use Text::CSV; use Inline::Files; { my %constructor_args; BEGIN { %constructor_args = (binary => 1, sep => '|'); } sub CSV () { Text::CSV::->new(\%constructor_args); } } for my $fh (\*SECOND, \*FIRST) { while (my $row = CSV->getline($fh)) { print "@$row[1,2]\n"; } } __FIRST__ a|b|c d|e|f __SECOND__ g|h|i j|k|l