[plug] Perl Question

Ryan ryan at is.as.geeky.as
Mon Mar 8 16:04:19 WST 2004


On Mon, 2004-03-08 at 15:45, Trevor Phillips wrote:
> On Monday 08 March 2004 15:15, Ryan wrote:
> >
> > Some eval/require magic perhaps?
> >
> > See middle of:  http://www.perldoc.com/perl5.8.0/pod/func/require.html

This will tell you what is loaded:

my $key;

foreach $key (sort keys(%INC)) {
   print "$key => $INC{$key}\n";
}

For example if you made module.pm and use/require it, you'll get:

module.pm => /some/path/module.pm

Can you grep the hash for your $foo thing and see if it is 
already loaded and go from there?

If it IS loaded and you want to call it, you can do some dodgy
reference that I forget how to do, the idea of which is do
to something like this:  &$foo::baa() (but I'm almost positive
that is wrong and I can't test it right now) :)

Check on perlmonks, that will find it for you pretty quick.

Ryan




More information about the plug mailing list