Wow, that's a lot of excessive work; why use the hash, when a regex can count matches?
my @keep; while ( chomp(my $num = <DATA>) ) { for ( split //, $num ) { my @a = ($num =~ m/$_/g); #count occurances if (@a>1) { push @keep, $num; last; } #keep if more than one } }
In reply to Re^2: Find duplicate digits
by radiantmatrix
in thread Find duplicate digits
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |