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