Click here to get back home

use module

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
use module a 03-03-2007
|--> Re: use module Erik Warmelink03-03-2007
Posted by a on March 3, 2007, 5:13 am
Please log in for more thread options


Hi

What is the difference between
use Module
use Module ()
use Module (func1 func2)
?
And, what is the different require and use?

Thanks



Posted by Erik Warmelink on March 3, 2007, 10:14 am
Please log in for more thread options



> What is the difference between
> use Module
> use Module ()
> use Module (func1 func2)
> ?
> And, what is the different require and use?

``perldoc -f use'' and ``perldoc -f require'' explain it better than
I could.

--
erik@selwerd.nl

Posted by Sisyphus on March 3, 2007, 6:31 pm
Please log in for more thread options



> Hi
>
> What is the difference between
> use Module
Will import only whatever is in @Module::EXPORT

> use Module ()
will import nothing.

> use Module (func1 func2)
will import only func1 and func2 (but only if func1 and func2 are in
@Module::EXPORT_OK).

See 'perldoc Exporter'.

Note that functions that have not been imported can still be accessed, but
to do that they have to be called by their fully qualified names - ie
Module::func1() and Module::func2(), instead of just func1() and func2().

Cheers,
Rob


Posted by Paul Lalli on March 3, 2007, 10:13 pm
Please log in for more thread options


> > Hi
>
> > What is the difference between
> > use Module
>
> Will import only whatever is in @Module::EXPORT
>
> > use Module ()
>
> will import nothing.
>
> > use Module (func1 func2)
>
> will import only func1 and func2 (but only if func1 and func2 are in
> @Module::EXPORT_OK).

... or @Module::EXPORT

Paul Lalli


Similar ThreadsPosted
Lower case module name for non-pragma module January 4, 2005, 10:19 am
RFC: New module 'Module::Bundled::Files' August 26, 2005, 3:49 pm
help with an MD5.pm module!! September 3, 2005, 11:39 pm
Looking for RTP module December 9, 2004, 9:17 pm
module for FFT May 9, 2005, 3:06 pm
Module may not be right one? April 27, 2006, 12:57 pm
The 'if' module June 1, 2006, 8:18 pm
The 'if' module June 1, 2006, 8:26 pm
Name my Module! July 27, 2007, 6:46 pm
Yet another TL1 module August 7, 2007, 4:12 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap