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

The solution I posted is a one-line perl command, to be run from a command shell prompt, not to be embedded within a perl source file.

If you're running under *nix, then you'll have to exchange the quotes like so:

perl -le'%h=(), undef @h{split"",$_}, keys %h == 3 and print for "0000 +".."9999"'

The following will run as a script:

#!/usr/bin/perl -lw use strict; for ( '0000'..'9999' ) { my %h; undef @h{split'',$_}; keys %h == 3 and print; }

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"I'd rather go naked than blow up my ass"

Replies are listed 'Best First'.
Re^5: Find duplicate digits
by mroman (Initiate) on Apr 07, 2010 at 14:15 UTC

    Thank you sir - that did it :)
    Hooray . . . now on to the next step of my Evil Masterplan ;-)

    Cheers,
    M.ROMAN