PMLOAD(1)

πŸ“¦
version 2.2.0 Β· 3 versions
, in epel 9

πŸ’– NAME πŸ’–

okay so pmload β€” yes bestie, that's the manual name, periodt β€” is a lil icon from the user-contributed Perl docs. It shows what files a given module loads at compile time. That's the whole assignment. πŸ’…

✨ DESCRIPTION ✨

You hand pmload one argument: a module name. Then it shows you all the files that are loaded directly or indirectly when that module is used at compile-time. no cap, that's the entire description. πŸ¦‹

πŸŽ€ EXAMPLES πŸŽ€

vibe check, let's run her:

$ pmload IO::Handle
/usr/local/devperl/lib/5.00554/Exporter.pm
/usr/local/devperl/lib/5.00554/Carp.pm
/usr/local/devperl/lib/5.00554/strict.pm
/usr/local/devperl/lib/5.00554/vars.pm
/usr/local/devperl/lib/5.00554/i686-linux/DynaLoader.pm
/usr/local/devperl/lib/5.00554/i686-linux/IO/Handle.pm
/usr/local/devperl/lib/5.00554/Symbol.pm
/usr/local/devperl/lib/5.00554/i686-linux/IO/File.pm
/usr/local/devperl/lib/5.00554/SelectSaver.pm
/usr/local/devperl/lib/5.00554/i686-linux/Fcntl.pm
/usr/local/devperl/lib/5.00554/AutoLoader.pm
/usr/local/devperl/lib/5.00554/i686-linux/IO.pm
/usr/local/devperl/lib/5.00554/i686-linux/IO/Seekable.pm

like, so many paths, so little time 😭

$ cat `pmload IO::Socket` | wc -l
   4015

and this one is giving old-school energy:

$ oldperl -S pmload Tk
/usr/lib/perl5/site_perl/Tk/Pretty.pm
/usr/lib/perl5/Symbol.pm
/usr/lib/perl5/site_perl/Tk/Frame.pm
/usr/lib/perl5/site_perl/Tk/Toplevel.pm
/usr/lib/perl5/strict.pm
/usr/lib/perl5/Exporter.pm
/usr/lib/perl5/vars.pm
/usr/lib/perl5/site_perl/auto/Tk/Wm/autosplit.ix
/usr/lib/perl5/site_perl/auto/Tk/Widget/autosplit.ix
/usr/lib/perl5/site_perl/Tk.pm
/usr/lib/perl5/i386-linux/5.00404/DynaLoader.pm
/usr/lib/perl5/site_perl/auto/Tk/Frame/autosplit.ix
/usr/lib/perl5/site_perl/auto/Tk/Toplevel/autosplit.ix
/usr/lib/perl5/Carp.pm
/usr/lib/perl5/site_perl/auto/Tk/autosplit.ix
/usr/lib/perl5/site_perl/Tk/CmdLine.pm
/usr/lib/perl5/site_perl/Tk/MainWindow.pm
/usr/lib/perl5/site_perl/Tk/Submethods.pm
/usr/lib/perl5/site_perl/Tk/Configure.pm
/usr/lib/perl5/AutoLoader.pm
/usr/lib/perl5/site_perl/Tk/Derived.pm
/usr/lib/perl5/site_perl/Tk/Image.pm
/usr/lib/perl5/site_perl/Tk/Wm.pm
/usr/lib/perl5/site_perl/Tk/Widget.pm

πŸ¦‹ NOTE πŸ¦‹

important caveat, bestie β€” don't skip this. If the programmers used a delayed require, those files won't show up. Furthermore, this doesn't show all possible files that get opened, just the ones that show up in %INC. Most systems have a way to trace system calls. You can use this to find the real answer. First, get a baseline with no modules loaded.

$ strace perl -e 1 2>&1 | perl -nle '/^open\("(.*?)".* = [^-]/ && print $1'
/etc/ld.so.cache
/lib/libnsl.so.1
/lib/libdb.so.2
/lib/libdl.so.2
/lib/libm.so.6
/lib/libc.so.6
/lib/libcrypt.so.1
/dev/null

$ strace perl -e 1 2>&1 | grep -c '^open.*= [^-]'
8

Now add module loads and see what you get:

$ strace perl -MIO::Socket -e 1 2>&1 | grep -c '^open.*= [^-]'
24

$ strace perl -MTk -e 1 2>&1 | grep -c '^open.*= [^-]'
35

🌈 SEE ALSO 🌈

go look at these too, iykyk:

πŸ‘‘ AUTHORS and COPYRIGHTS πŸ‘‘

  • Copyright (C) 1999 Tom Christiansen.
  • Copyright (C) 2006-2014 Mark Leighton Fisher.

πŸ’œ LICENSE πŸ’œ

okay legal queen moment, serving it exactly:

This is free software; you can redistribute it and/or modify it under the terms of either: (a) the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version, or (b) the Perl "Artistic License". (This is the Perl 5 licensing scheme.)

Please note this is a change from the original pmtools-1.00 (still available on CPAN), as pmtools-1.00 were licensed only under the Perl "Artistic License".


okay bye bestie β€” this PMLOAD(1) page is from perl v5.32.1, dated 2022-01-21; mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from