Module::Version::Loaded - Get a versioned list of currently loaded modules
version 0.000003
use Module::Version::Loaded qw( versioned_modules ); my %modules = versioned_modules(); # %modules contains: ( Foo::Bar => 0.01, Bar::Foo => 1.99, ... ) # You can test this with a series of one-liners perl -MModule::Version::Loaded=store_versioned_modules -MTest::More -e "store_versioned_modules('test-more.txt')" perl -MModule::Version::Loaded=store_versioned_modules -MApp::Prove -e "store_versioned_modules('app-prove.txt')" perl -MModule::Version::Loaded=diff_versioned_modules -e "diff_versioned_modules('test-more.txt','app-prove.txt')"
BETA BETA BETA
This module exists solely to give you a version of your %INC which includes the versions of the modules you have loaded. This is helpful when troubleshooting different environments. It makes it easier to see, at glance, which versions of modules you have actually loaded.
Returns a Hash of module versions, which is keyed on module name.
Hash
use Module::Version::Loaded qw( versioned_modules ); my %modules = versioned_modules(); # contains: ... vars => 1.03, version => 0.9912, version::regex => 0.9912, version::vxs => 0.9912, ...
Returns a Hash of module versions, which uses the same keys as %INC. This makes it easier to compare this data which %INC, since both Hashes will share the same keys.
use Module::Version::Loaded qw( versioned_inc ); my %inc = versioned_inc(); # contains: ... version.pm => 0.9912, version/regex.pm => 0.9912, version/vxs.pm => 0.9912, warnings.pm => 1.18, ... foreach my $key ( %INC ) { print "$key $INC{$key} $inc{$key}\n"; }
Serializes your versioned module list to an arbitrary file name which you must provide.
Requires the name of two files, which have previously been serialized via store_versioned_modules. Uses Data::Difflet to print a comparison of these data structures to STDOUT.
store_versioned_modules
Data::Difflet
You can do this with a one-line to save time:
perl -MModule::Version::Loaded=diff_versioned_modules -e "diff_versioned_modules('file1','file2')"
Olaf Alders <olaf@wundercounter.com>
This software is Copyright (c) 2015 by MaxMind, Inc..
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
To install Module::Version::Loaded, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Module::Version::Loaded
CPAN shell
perl -MCPAN -e shell install Module::Version::Loaded
For more information on module installation, please visit the detailed CPAN module installation guide.