in reply to counting number of fileds

my @last_three = ( split /,/ )[ -3 .. -1 ];

See perldata (for arrays and lists), perlfunc (for split), and perlop (for ..)

--
http://fruiture.de