http://qs1969.pair.com?node_id=681911

Sometimes things break because code that worked with certain versions of modules does not work with others. This short block just dumps all the modules in use, with their version numbers when a script exits. By doing it in an END block you get a realistic picture of what got loaded and it will still print if your code dies for whatever reason.
END{ no strict; # access $VERSION by symbolic reference print map { s!/!::!g; s!.pm$!!; sprintf "%-20s %s\n", $_, ${"${_}::VERSION"} } sort keys %INC; };

Replies are listed 'Best First'.
Re: List all modules and versions used by a program
by Fletch (Bishop) on Apr 21, 2008 at 15:00 UTC

    Possibly also of interest would be Module::ScanDeps from CPAN (although that's more of a static analysis than after-the-fact diagnostic).

    The cake is a lie.
    The cake is a lie.
    The cake is a lie.

Re: List all modules and versions used by a program (Devel::Modlist)
by lodin (Hermit) on Apr 21, 2008 at 23:37 UTC

    There's also Devel::Modlist, used like

    perl -d:Modlist=options script.pl perl -MDevel::Modlist=options script.pl # equivalent
    which is handy as it doesn't require any modification of the program itself.

    lodin

Re: List all modules and versions used by a program
by Discipulus (Canon) on Apr 03, 2014 at 10:33 UTC
    take a look to this one too.

    HtH
    L*
    There are no rules, there are no thumbs..
    Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.