in reply to Finding dependancies of a script
Same basic idea, but saves some of the futzing.
Update:
Changed die to exit.
Changed it back, as exit doesn't prevent the script from continuing passed the CHECK sub?
package Dependancies; sub CHECK { print $_, $/ for values %INC; die; } 1;
Then just add it to the command line with the -M switch.
P:\test>perl58 -MDependancies p1.pl8 d:/Perl/lib/warnings/register.pm d:/Perl/lib/bytes.pm d:/Perl/lib/XSLoader.pm d:/Perl/lib/Carp.pm d:/Perl/lib/Exporter.pm d:/Perl/lib/strict.pm d:/Perl/lib/warnings.pm d:/Perl/lib/overload.pm d:/Perl/lib/Shell.pm d:/Perl/lib/Data/Dumper.pm Dependancies.pm Died at Dependancies.pm line 5. CHECK failed--call queue aborted.
It probably needs a better name. Maybe something in the Devel::* namespace?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Finding dependancies of a script
by sauoq (Abbot) on Jul 25, 2003 at 20:32 UTC | |
by BrowserUk (Patriarch) on Jul 25, 2003 at 22:22 UTC | |
by sauoq (Abbot) on Jul 25, 2003 at 23:30 UTC | |
by BrowserUk (Patriarch) on Jul 25, 2003 at 23:48 UTC | |
by sauoq (Abbot) on Jul 26, 2003 at 00:42 UTC |