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);
In reply to Re: iterating through array and saving matches to new array
by pwagyi
in thread iterating through array and saving matches to new array
by jazzfan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |