Jon said:
Hi,
I'm curious to know what CPAN modules people use in their general day-to-day
perl scripting (or can't live without). For example I make lots of use of
the Date::Manip module and would hate to have to ever implement something
like that.
I found a script that I made in response to a similar question four years
ago which counted the most frequently used modules in example code and the
output (as it stood then, I get my news differently now so I can't re-run it):
CGI 65
Net::FTP 55
File::Find 53
Win32::OLE 49
Date:
arse 49
LWP::UserAgent 40
IO::Socket 36
Date::Manip 32
Benchmark 29
Math::BigInt 28
HTML:
arser 24
DBI 20
DBD::Oracle 17
CGI::Carp 17
Time::JulianDay 16
HTTP::Request 16
Net::SMTP 16
IO::File 15
URI::Escape 14
Socket 14
I can't find the original message on Google.
For those interested the code was:
#!/usr/bin/perl -w
use strict;
my $dirname = "/var/spool/news/comp/lang/perl/misc/";
opendir(DIR,$dirname) || die "No diretory";
my @files = map { $dirname . $_ ; } grep !/^\./, readdir(DIR);
my %modules;
FILES:
foreach(@files)
{
open(FILE,$_) || next;
while(<FILE>)
{
next FILES if (/^--/);
next if /^[>+#:]/;
next if /^Subject:/;
chomp;
if (/perl +-\w*?M(\w+(?:
*\w*)\b/ ||
/\b(\w+?::\w+?);?\b/ ||
/\buse +([A-Z]\w+(?:
*\w*)/)
{
$modules{$1}++;
}
}
}
my @sorted = reverse sort { $a->[1] <=> $b->[1] }
map { [ $_,$modules{$_}]}
keys %modules;
foreach (@sorted)
{
printf("%-60s%i\n",$_->[0],$_->[1]);
}
/J\