Ramprasad A Padmanabhan wrote at Mon, 30 Sep 2002 09:36:50 +0200:

> How do I find in a function if a particular module is already loaded
> 
> for eg,
> 
> sub mysub {
>       my @vars = @_;
>       require Data::Dumper unless ( already_required('Data::Dumper'));
>       print Data::Dumper::Dumper(\@vars);
> }
> 
> I want help writing the function already_required()

You don't need it.
>From perldoc -f require:

               Otherwise, demands that a library file be included
               if it hasn't already been included.  The file is
               included via the do-FILE mechanism, which is
               essentially just a variety of "eval".  Has
               semantics similar to the following subroutine:

So a required module is only loaded when it hadn't been loaded yet.


Greetings,
Janek

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to