The solution offered by ikegami is really the Right Thing here, but - just to be silly -
#!/usr/bin/perl -wl use strict; my @a; $a[ord($_)-65]++ for <DATA>; print "There are $a[$_] element(s) of ", chr($_+65) for 0..$#a; __DATA__ A B C D A B A C A D
In reply to Re: How to find number of unique elemenst in array
by oko1
in thread How to find number of unique elemenst in array
by gasho
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |