Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
my @input = <DATA>;
chomp @input;
# count instances of each item
my %dupes = ();
foreach (@input) {
$dupes{$_}++;
}
# sort them by no. of duplicates descending and print
foreach my $dup (sort { $dupes{$b} <=> $dupes{$a} } keys %dupes) {
print "$dup was found $dupes{$dup} times\n";
}
__DATA__
1
2
5
6
2
8
9
10
1
3
200
50
3
2
1
C:\Documents and Settings\Kirsle\My Documents>perl test.pl
2 was found 3 times
1 was found 3 times
3 was found 2 times
6 was found 1 times
50 was found 1 times
9 was found 1 times
8 was found 1 times
200 was found 1 times
10 was found 1 times
5 was found 1 times
perl -e '$|=$i=1;print" oo\n<|>\n_|_";x:sleep$|;print"\b",$i++%2?"/":"_";goto x;'
What have you tried so far?