my $input = 'Stream'->new(fh => *STDIN); while (@points < $n) { my ($x, $y) = map $input->next_token, 1, 2; push @points, 'Point'->new(x => $x, y => $y); }