Чтобы обработать файл с разделителем запятыми или табуляцией, вы можете попробовать:
#!/usr/bin/perl
use Modern::Perl;
use Data::Dumper;
my @rows;
while(<DATA>) {
chomp;
my ($delim) = $_ =~ /(,|\t)/;
my @fields = split/,|\t/;
$fields[2] = reverse $fields[2];
push @rows, join $delim, @fields;
}
say Dumper \@rows;
__DATA__
2 AX Mariehamn Mariehamn ACTIVE 2011-03-15 17:23:12 2011-03-15 17:23:12 SYSTEM Al-Ma
4 DZ Adrar Adrar ACTIVE 2011-03-15 17:23:12 2011-03-15 17:23:12 SYSTEM Al-Ad
6 DZ Ain Defla Ain Defla ACTIVE 2011-03-15 17:23:12 2011-03-15 17:23:12 SYSTEM Al-Ai
8 DZ Ain Temchent Ain Temchen ACTIVE 2011-03-15 17:23:12 2011-03-15 17:23:12 SYSTEM Al-Ai
10 DZ Shantanu Shantanu ACTIVE 2011-03-15 17:23:12 2011-03-15 17:23:12 SYSTEM Al-Al
2,"AX","Mariehamn","Mariehamn","ACTIVE","2011-03-15 17:23:12","2011-03-15 17:23:12","SYSTEM","Al-Ma"
4,"DZ","Adrar","Adrar","ACTIVE","2011-03-15 17:23:12","2011-03-15 17:23:12","SYSTEM","Al-Ad"
6,"DZ","Ain Defla","Ain Defla","ACTIVE","2011-03-15 17:23:12","2011-03-15 17:23:12","SYSTEM","Al-Ai"
8,"DZ","Ain Temchent","Ain Temchent","ACTIVE","2011-03-15 17:23:12","2011-03-15 17:23:12","SYSTEM","Al-Ai"
10,"DZ","Shantanu","Shantanu","ACTIVE","2011-03-15 17:23:12","2011-03-15 17:23:12","SYSTEM","Al-Al"
выход:
$VAR1 = [
'2 AX nmaheiraM Mariehamn ACTIVE 2011-03-15 17:23:12 2011-03-15 17:23:12 SYSTEM Al-Ma',
'4 DZ rardA Adrar ACTIVE 2011-03-15 17:23:12 2011-03-15 17:23:12 SYSTEM Al-Ad',
'6 DZ alfeD niA Ain Defla ACTIVE 2011-03-15 17:23:12 2011-03-15 17:23:12 SYSTEM Al-Ai',
'8 DZ tnehcmeT niA Ain Temchen ACTIVE 2011-03-15 17:23:12 2011-03-15 17:23:12 SYSTEM Al-Ai',
'10 DZ unatnahS Shantanu ACTIVE 2011-03-15 17:23:12 2011-03-15 17:23:12 SYSTEM Al-Al',
'',
'2,"AX","nmaheiraM","Mariehamn","ACTIVE","2011-03-15 17:23:12","2011-03-15 17:23:12","SYSTEM","Al-Ma"',
'4,"DZ","rardA","Adrar","ACTIVE","2011-03-15 17:23:12","2011-03-15 17:23:12","SYSTEM","Al-Ad"',
'6,"DZ","alfeD niA","Ain Defla","ACTIVE","2011-03-15 17:23:12","2011-03-15 17:23:12","SYSTEM","Al-Ai"',
'8,"DZ","tnehcmeT niA","Ain Temchent","ACTIVE","2011-03-15 17:23:12","2011-03-15 17:23:12","SYSTEM","Al-Ai"',
'10,"DZ","unatnahS","Shantanu","ACTIVE","2011-03-15 17:23:12","2011-03-15 17:23:12","SYSTEM","Al-Al"'
];