my @array = (); for( my $i = 0; $i < 10; $i++) { $count++; push @array, $i; } print "There are $count elements\n";