PASTEBIN
| #1 paste tool since 2002
create new paste
tools
api
archive
faq
PASTEBIN
create new paste
trending pastes
sign up
login
my alerts
my settings
my profile
Don't like ads?
PRO users
don't see any ads ;-)
Public Pastes
Untitled
5 sec ago
Untitled
7 sec ago
Untitled
10 sec ago
Untitled
16 sec ago
Untitled
18 sec ago
Untitled
21 sec ago
Untitled
27 sec ago
Untitled
28 sec ago
knarf
By: a guest on
Mar 1st, 2009
| syntax:
Perl
| size: 0.13 KB | hits: 96 | expires: Never
download
|
raw
|
embed
|
report abuse
|
print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
open
$file
,
'test.txt'
;
map
{
$freq
{
lc
$_
}
++
}
split
for
<
$file
>;
say
"$_: $freq{$_}"
for
sort
{
$freq
{
$b
}
<=>
$freq
{
$a
}
}
keys
%freq
;
create a
new version
of this paste
RAW Paste Data
open $file, 'test.txt'; map {$freq{lc $_}++} split for <$file>; say "$_: $freq{$_}" for sort {$freq{$b} <=> $freq{$a}} keys %freq;