Beefy Boxes and Bandwidth Generously Provided by pair Networks Cowboy Neal with Hat
We don't bite newbies here... much
 
PerlMonks  

Re: Re: Re: Modules: Building blocks for the Daft Adventure

by davorg (Chancellor)
on Jun 12, 2001 at 12:06 UTC ( [id://87782]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Re: Re: Modules: Building blocks for the Daft Adventure
in thread Modules: Building blocks for the Daft Adventure

@ISA does the same thing here that it does in an OO module. It defines other modules that Perl should search for subroutines that you don't define in your module.

For example, in this case use Module is (almost) the same as:

require Module; Module::import;

So Perl tries to call the import function in your module. Your module doesn't have an import function so Perl searches the modules in @ISA and calls the first instance of import that it finds. This is in Exporter. Exporter::import does all sorts of clever things and exports the contents of your @EXPORT_OK array into the calling package.

Update: Ridiculous typo corrected. Thanks to ryddler.

--
<http://www.dave.org.uk>

Perl Training in the UK <http://www.iterative-software.com>

Replies are listed 'Best First'.
Re: Re: Re: Re: Modules: Building blocks for the Daft Adventure
by ryddler (Monk) on Jun 12, 2001 at 15:14 UTC

    Your module doesn't have an import function so Perl searches the modules in @INC and calls the first instance of import that it finds.

    I'm wondering if you meant to say:

    Your module doesn't have an import function so Perl searches the modules in @ISA and calls the first instance of import that it finds.


    ryddler

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://87782]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.