in reply to count sort & output
my @patterns = qw( a b c d e f g h i j k l m n o p q r s t u v w x y z + ); my %hash; my $data = do { local $/; <DATA> }; for (@patterns) { $hash{$_}++ for $data =~ /\Q$_\E/g; } my $counter = 0; for (sort {$hash{$b} <=> $hash{$a}} keys %hash) { print "$_ - $hash{$_}\n"; unless (++$counter % 10) { print "Press Enter"; <STDIN> } } __END__ Four score and seven years ago our fathers brought forth on this continent a new nation, conceived in liberty and dedicated to the proposition that all men are created equal.
-sauoq "My two cents aren't worth a dime.";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: count sort & output
by Anonymous Monk on Dec 19, 2002 at 11:37 UTC | |
by sauoq (Abbot) on Dec 19, 2002 at 17:20 UTC | |
by Anonymous Monk on Dec 19, 2002 at 22:21 UTC |