in reply to iterating through array and saving matches to new array

As other monks had pointed out, use lexical scope (my over our). and grep is definitely suitable here. I'm not exactly sure why you need even grep/filtering if you want to find numbers between 850 and 1000? You could as well use.

my $lower_bound = 850; my $upper_bound = 1000; my @newa = ($lower_bound+1 .. $upper_bound);