Posts in this category

Tue, 09 Jun 2009

Small Perl Helpers

CoreList

You want to use a module, but you're only allowed to use core modules? Or
you want to recommend a module to somebody, and you know it's more likely that
he'll use a module if it's in core (and thus he won't hand-roll his crappy CGI
parser, and open a wide door to spammers)?

Module::CoreList is
the answer, and it comes with a very handy script called
corelist:

$ corelist Unicode::Normalize
Unicode::Normalize was first released with perl 5.007003
$ corelist DBI
DBI was not in CORE (or so I think)
# search with regexes
$ corelist /Tie/
Pod::Simple::TiedOutFH was first released with perl 5.009003
Tie::Array was first released with perl 5.005
Tie::File was first released with perl 5.007003
Tie::Handle was first released with perl 5.00405
Tie::Hash was first released with perl 5.002
Tie::Hash::NamedCapture was first released with perl 5.009005
Tie::Memoize was first released with perl 5.007003
Tie::RefHash was first released with perl 5.004
Tie::Scalar was first released with perl 5.002
Tie::StdHandle was first released with perl 5.01
Tie::SubstrHash was first released with perl 5.002
TieHash was first released with perl 5

(empty lines sanitized; corelist emits an empty line after each module
which is a bit annoying)

If called with no argument it will print the current time as a Unix
timestamp. If called with one or two arguments, it will interpret these as a
date in the YYYY-MM-DD and a time in HH:MM:SS format
and print the corresponding timestamp.