On Fri, 15 Sep 2000, Stas Bekman wrote:
> On Fri, 15 Sep 2000, Matt Sergeant wrote:
>
> > On Thu, 14 Sep 2000, Justin wrote:
> >
> > > Can anyone tell me the easiest slickest way of determining
> > > what was responsible for requesting a module, having discovered
> > > that it has been loaded when viewing perl-status?
> >
> > use OtherPackage; # because you need import to be defined first
> > sub OtherPackage::import {
> > warn join(':', caller), " tried to load me\n";
> > }
>
> Not really. import() is not called for any of these.
> use Foo ();
> require Foo;
> do Foo;
>
> BEGIN{}+cluck in the code or just cluck will do per my original reply.
Yep, its a better solution in most cases, except you have to edit the
original package for it to work. Sometimes thats not possible (e.g. on a
system you don't have admin rights for). So two solutions to the problem
are simply good to know.
--
<Matt/>
Fastnet Software Ltd. High Performance Web Specialists
Providing mod_perl, XML, Sybase and Oracle solutions
Email for training and consultancy availability.
http://sergeant.org | AxKit: http://axkit.org