#!/usr/bin/perl -w -s use Lingua::PT::PLN; our($log); my $file; my $dfile = 0; if (@ARGV) { $file = shift; } else { $file = "/tmp/_$$"; open F, ">$file" or die "Can't create temporary file: $!"; print F while <>; close F; $dfile = 1; } my %ops=(); $ops{log}=$log if $log; my %o = oco({%ops},$file); for (sort { $o{$b}<=>$o{$a} } keys %o) { printf("%20s %d\n",$_,$o{$_}); } unlink $file if $dfile; =head1 NAME occurrences - Calculate a histogram of word occurrences count =head1 SYNOPSIS occurrences =head1 DESCRIPTION This script count different words and prints a final report ordered by word count. =head1 SEE ALSO Lingua::PT::PLN =head1 AUTHOR Alberto Manuel Brandão Simões, Eambs@cpan.orgE =head1 COPYRIGHT AND LICENSE Copyright (C) 2008 by Projecto Natura =cut