my @new_array = grep {$_ >= $first_val and $_ <= $second_val} @old_array;