while(<>) { chomp; my (@stuff) = split(","); push(@lines, \@stuff); } $size=@lines; # just printing the 4th element in each row. for($i=0; $i<$size; $i++) { print("item: $lines[$i]->[3]\n"); }