print number_of_uniques('ppppppperlguy') . "\n"; sub number_of_uniques { my %s; return scalar (grep !$s{$_}++, split '', $_[0]); }
In reply to Re: number of unique characters in a string
by perlguy
in thread number of unique characters in a string
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |