The problem that in one example $second_val is a signed floating point number like -0.0999999999, however grep matched the number to be 0.0999999999 instead so @new_array now contains different values to what I expected. Is there a different way to do this where I won't encounter this problem??my @new_array = grep {$_ == $first_val .. $_ == $second_val} @old_arra +y;
Cheers!
In reply to using grep to extract numbers from an array by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |