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 | |
Re: List all modules and versions used by a program (Devel::Modlist)
by lodin (Hermit) on Apr 21, 2008 at 23:37 UTC | |
Re: List all modules and versions used by a program
by Discipulus (Canon) on Apr 03, 2014 at 10:33 UTC |
Back to
Cool Uses for Perl