Which modules are currently loaded by process?
Have you ever wondered which modules are currently loaded by current process? With Perl it's very simple to know this piece of info. Perl saves loaded modules in a hash %INC.
Lets have some dirty hands:
use Data::Dumper; print STDERR Dumper \%INC;
The output is as follows:
$VAR1 = { 'warnings/register.pm' => '/usr/share/perl5/warnings/register.pm', 'bytes.pm' => '/usr/share/perl5/bytes.pm', 'XSLoader.pm' => '/usr/lib64/perl5/XSLoader.pm', 'Carp.pm' => '/usr/share/perl5/Carp.pm', 'Exporter.pm' => '/usr/share/perl5/Exporter.pm', 'warnings.pm' => '/usr/share/perl5/warnings.pm', 'overload.pm' => '/usr/share/perl5/overload.pm', 'Data/Dumper.pm' => '/usr/lib64/perl5/Data/Dumper.pm' };
The hash simply contains the module path as value.
So this can be used for cleaning up too, with it you can figure out why you're not getting the version of the module you're expecting, for example.