in reply to Find duplicate digits

@m = grep {/(\d).*\1/ and !/(\d).*\1.*\1/} '0000' .. '9999'