Module...Report(3pm)

🌸 Module::Versions::Report β€” bestie edition 🌸

okay so this is a page from the User Contributed Perl Documentation manual, and honestly? it's a little legend. it's Module::Versions::Report(3pm) and it exists so you never have to play twenty questions about which version of which module is acting up. iconic behavior, truly. πŸ’…


✨ NAME ✨

Module::Versions::Report β€” report versions of all modules in memory

like. all of them. every single one chillin' in memory, version-tagged. slay. πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

use Module::Versions::Report;

...and any code you want...

so here's the vibe: your code runs completely normally, business as usual, no notes. but then, right as the Perl interpreter is about to exit? it prints something like this:

Perl v5.6.1 under MSWin32.
 Modules in memory:
  attributes;
  AutoLoader v5.58;
  Carp;
  Config;
  DynaLoader v1.04;
  Exporter v5.562;
  Module::Versions::Report v1.01;
  HTML::Entities v1.22;
  HTML::HeadParser v2.15;
  HTML::Parser v3.25;
  [... and whatever other modules were loaded that session...]

(it does NOT care what your code did. it just waits. patiently. like a group chat lurker. then it spills everything. πŸ™ˆ)

and consider its use from the command line, because this is where it really ate:

% perl -MModule::Versions::Report -MLWP -e 1

Perl v5.6.1 under MSWin32.
 Modules in memory:
  attributes;
  AutoLoader v5.58;
  [...]

yeah. one -e 1. that's the whole program. that's it. periodt. πŸ”₯


πŸ’œ DESCRIPTION πŸ’œ

okay storytime, because the origin of this module is genuinely unhinged. 🫢

the author says he often got email from someone reporting a bug in a module he'd written. so he emails back, like, "hey bestie, what version of the module is it? what version of Perl, on what OS? and sometimes what version of some relevant third library (like XML::Parser)?" and they reply saying "Perl 5". πŸ’€

he says "I need the exact version, as reported by perl -v". they tell him. and then he says "I, uh, also asked about the version of my module and XML::Parser [or whatever]". they say "Oh yeah. It's 2.27". "Is that my module or XML::Parser?" "XML::Parser." "OK, and what about my module's version?" "Ohyeah. That's 3.11."

and by this time?? days have passed. DAYS. for something that should have been a simple operation β€” reporting the version of Perl and relevant modules β€” has been needlessly complicated. the way that a two-second task turned into a multi-day email saga. it's giving nightmare. 😭

so this module is for simplifying that task. if you add use Module::Versions::Report; to a program (especially handy if your program is one that demonstrates a bug in some module), then when the program has finished running, you well get a report detailing the all modules in memory, and noting the version of each β€” for modules that defined a $VERSION, at least. no more detective work. no more guessing. we simply know now. πŸ‘‘


🌈 USING 🌈

πŸŽ€ Importing πŸŽ€

if this package is imported then the END block is set, and a report is printed to stdout on program exit. so pick your fighter:

  • use use Module::Versions::Report; if you need a report on exit
  • use use Module::Versions::Report (); otherwise, and call the report or print_report functions yourself

lowkey love that the empty parens give you the manual-control version. main character energy. ✨

πŸ“ report and print_report functions πŸ“

  • the first one (report) returns the preformatted report as a string
  • the latter (print_report) outputs a report to stdout

one hands it to you, one just yells it into the terminal. both valid. πŸ’–


Copyright 2001-2003 Sean M. Burke. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose.

no cap, that warranty line is doing a LOT of heavy lifting β€” it's basically the "no refunds" of the software world. legal girlies know. πŸ’€

🧚 MAINTAINER 🧚

Ruslan U. Zakirov <ruz@bestpractical.com>


⭐ AUTHOR ⭐

Sean M. Burke, <sburke@cpan.org>


and that's the whole page, bestie β€” perl v5.36.0, dated 2022-10-13, straight from the Module...Report(3pm) corner of the Perl docs. go forth, use it, and never suffer through a version-guessing email chain again. πŸ«ΆπŸ’…βœ¨

πŸ“¦ where this page comes from