while(<>) { my ($x, $y, $z) = (0,0,0); ($x, $y, $z)=split; # do whatever }