Roll Call
In previous editions we included a list of all modules in the
Standard Library, but this book is already too long to devote tens of
pages to that, especially considering that you can just look in
perlmodlib
to see the list for your version of Perl. If you don’t like that, you
can make this list yourself by looking for all .pm files, then extracting the nonblank line
after =head1 NAME:
use v5.10;
use File::Find;
my %names;
my $wanted = sub {
return unless /\.pm\z/;
open(my $fh, "<", $File::Find::name)
|| die "can't open $File::Find::name: $!";
OUTER: while( <$fh> ) {
next unless /\A =head1 \s+ NAME/x;
while( <$fh> ) {
next if /\A \s* \z/x;
/ (?<name>\S+) \s* –+ \s* (?<desc>.*) /x;
$names{ $+{name} } = $+{desc};
last OUTER;
}
}
};
find($wanted, @INC);
for my $name (sort keys %names) {
printf "%–25s – %s\n", $name, $names{$name};
}With v5.14, that finds about 500 namespaces:
AnyDBM_File – provide framework for multiple DBMs
App::Cpan – easily interact with CPAN from
– the command line
App::Prove – Implements the C<prove> command.
... many others ...
warnings – Perl pragma to control optional warnings
warnings::register – warnings import function
writemain – write the C code for perlmain.cThere’s another way to get this. The Module::CoreList module, part of the Standard Perl Library, knows what
came with which Perl. Its corelist
module is the interface. To find the versions it knows about, use
the –v switch:
% corelist –v
5
5.000
5.001
5.002
...
v5.14.0
v5.14.1With a version, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access