in reply to using grep to extract numbers from an array

Are you sure you're using the range operator correctly? Your code will return the elements of @old_array from the occurrence of $first_val until the occurrence of $second_val, inclusive. Whereas a compare like jaa's will return the elements whose values are between $first_val and $second_val.
use strict; my $first_val = -3; my $second_val = -0.0999999999; my @old_array = <DATA>; print "Range operator\n"; my @new_array = grep {$_ == $first_val .. $_ == $second_val} @old_arra +y; print @new_array; print "\nComparison\n"; @new_array = grep {$_ >= $first_val and $_ <= $second_val} @old_array; print @new_array; __DATA__ -5 -3 7 0.0999999999 -0.0999999999 -2 -6 __OUTPUT__ Range operator -3 7 0.0999999999 -0.0999999999 Comparison -3 -0.0999999999 -2

--

flounder