in reply to Re: Find duplicate digits
in thread Find duplicate digits

another variation:

print grep { /(\d).*\1/ and eval "2 == tr/$1//" } map {sprintf "%04d +",$_} (0..9999)

Cheers Rolf