in reply to counting number of fileds
$_="1,2,3,4,5,6"; @lastthree=grep{$_ if$i++<3}reverse split/,/; [download]