my %results = map { $_ => 1 if ( $low_watermark < $_ && $_ < $high_watermark ) } @all_numbers;
will get all of the matching numbers
Not if any of the numbers are duplicates because you are storing them in hash keys which will remove duplicates.
Why not just:
my @results = grep $low_watermark < $_ && $_ < $high_watermark, @all_n +umbers;
In reply to Re^2: Array, element inside limits
by jwkrahn
in thread Array, element inside limits
by natol44
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |