| 1 |
#!/usr/bin/env perl |
| 2 |
# plxload -- show what files a perl program loads |
| 3 |
|
| 4 |
# ------ pragmas |
| 5 |
use strict; |
| 6 |
use warnings; |
| 7 |
|
| 8 |
our $VERSION = '2.0.0'; |
| 9 |
|
| 10 |
# ------ define variables |
| 11 |
my $filename = undef; # program filename |
| 12 |
|
| 13 |
BEGIN { $^W = 1 } |
| 14 |
BEGIN { die "usage: $0 filename\n" unless @ARGV == 1 } |
| 15 |
|
| 16 |
$filename = shift; |
| 17 |
|
| 18 |
use FindBin qw($Bin); |
| 19 |
|
| 20 |
exec "$^X -I$Bin -MDevel::Loaded -S -c $filename 2>/dev/null"; |
| 21 |
|
| 22 |
__END__ |
| 23 |
|
| 24 |
=head1 NAME |
| 25 |
|
| 26 |
plxload - show what files a perl program loads at compile time |
| 27 |
|
| 28 |
=head1 SYNOPSYS |
| 29 |
|
| 30 |
$ plxload |
| 31 |
|
| 32 |
=head1 DESCRIPTION |
| 33 |
|
| 34 |
This program is used to show what modules a program would load at |
| 35 |
compile time via C<use>. Because this installs an at-exit handler and |
| 36 |
then uses Perl's B<-c> flag for compile only, it will not find modules |
| 37 |
loaded at run-time. Use the Devel::Loaded module for that. |
| 38 |
|
| 39 |
=head1 EXAMPLES |
| 40 |
|
| 41 |
$ plxload perldoc |
| 42 |
/usr/local/devperl/lib/5.00554/Exporter.pm |
| 43 |
/usr/local/devperl/lib/5.00554/strict.pm |
| 44 |
/usr/local/devperl/lib/5.00554/vars.pm |
| 45 |
/usr/local/devperl/lib/5.00554/i686-linux/Config.pm |
| 46 |
/usr/local/devperl/lib/5.00554/Getopt/Std.pm |
| 47 |
|
| 48 |
$ plxload /usr/src/perl5.005_54/installhtml |
| 49 |
/usr/local/devperl/lib/5.00554/Carp.pm |
| 50 |
/usr/local/devperl/lib/5.00554/Exporter.pm |
| 51 |
/usr/local/devperl/lib/5.00554/auto/Getopt/Long/autosplit.ix |
| 52 |
/usr/local/devperl/lib/5.00554/strict.pm |
| 53 |
/usr/local/devperl/lib/5.00554/vars.pm |
| 54 |
/usr/local/devperl/lib/5.00554/Pod/Functions.pm |
| 55 |
/usr/local/devperl/lib/5.00554/Getopt/Long.pm |
| 56 |
/usr/local/devperl/lib/5.00554/i686-linux/Config.pm |
| 57 |
/usr/local/devperl/lib/5.00554/lib.pm |
| 58 |
/home/tchrist/perllib/Pod/Html.pm |
| 59 |
/usr/local/devperl/lib/5.00554/Cwd.pm |
| 60 |
/usr/local/devperl/lib/5.00554/AutoLoader.pm |
| 61 |
|
| 62 |
=head1 SEE ALSO |
| 63 |
|
| 64 |
L<Devel::Loaded> and pmload(1). |
| 65 |
|
| 66 |
=head1 AUTHORS and COPYRIGHTS |
| 67 |
|
| 68 |
Copyright (C) 1999 Tom Christiansen. |
| 69 |
|
| 70 |
Copyright (C) 2006-2014 Mark Leighton Fisher. |
| 71 |
|
| 72 |
=head1 LICENSE |
| 73 |
|
| 74 |
This is free software; you can redistribute it and/or modify it |
| 75 |
under the terms of either: |
| 76 |
(a) the GNU General Public License as published by the Free |
| 77 |
Software Foundation; either version 1, or (at your option) any |
| 78 |
later version, or |
| 79 |
(b) the Perl "Artistic License". |
| 80 |
(This is the Perl 5 licensing scheme.) |
| 81 |
|
| 82 |
Please note this is a change from the |
| 83 |
original pmtools-1.00 (still available on CPAN), |
| 84 |
as pmtools-1.00 were licensed only under the |
| 85 |
Perl "Artistic License". |