$i = -1; while (){ chomp; $i++; ($last[$i], $first[$i], $age[$i], $sex[$i], $height[$i], $weight[$i]) = split/,/; } die "Sorry, no data\n" if $i == -1;