my @keep; # numbers to keep while(chomp( my $line = <NUMBERS> ) ) { my @digits = split '', $line; my %count; ++$count{$_} for @digits; if( grep { $_ == 2 } values %count ) { push @keep, $line; } }
In reply to Re: Find duplicate digits
by friedo
in thread Find duplicate digits
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |