http://www.perlmonks.org?node_id=1012437

Cody Fendant has asked for the wisdom of the Perl Monks concerning the following question:

Inspired by the fact that 2013 is the first year since 1987 which has four unique digits, what's your best code to determine the number of unique digits in a number?

Here's what I ended up with, skipping the %unique method:

$y = 2013; ($y = join('',sort(split(//,$y)))) =~ tr/0-9//s; print "unique digits: " . length($y) . $/;

I'm sure there's something smarter.