Sally/Kevin, :)

        The short answer is that Exporter is used when creating Perl modules.  It
allows other programs/modules to import functions and variables, either
explicitly or implicitly, into their own namespace.
        Long answer -- see 'perldoc Exporter' on most systems with Perl installed.
        On the subject, as someone who is relatively new to writing their own
modules, I have a namespace/scoping question.  I think I know the answer,
but I wanted to get the lists' insight.
        Let's say I have my main program, 'control.pl'.  In this program, I 'use
myModule;' which currently exports a single function.  Now, from
'myModule.pm', I want to 'use anotherModule;' which exports all but two
functions.
        Now, within 'anotherModule.pm', I wish to read from a variable in
'myModule.pm'.  Having assumed that, since the function needing the variable
was imported into 'myModule.pm's namespace, I am simply looking at
'$variable'.  This does not work.  However, I *can* get to it by
'$myModule::variable'.
        What am I missing here?  Why can I not access a parent package's variables
within the sibling's namespace?  Or, am I just WAY off base and missing the
entire concept. :)  Thanks in advance.

++========================================================================++
|| UNIREZ, Inc.                                            Scott Thompson ||
++-------------------------------------------+----------------------------++
|| Address: 2555 Southwest Grapevine Parkway | Title:     Programmer      ||
||          Suite 200                        | Phone:     (817) 416-5800  ||
||          Grapevine, Texas 76051           | Extension: 104             ||
|| Fax:     (817) 251-9199                   | Cell:      (972) 342-5660  ||
|| Web:     http://www.unirez.com/           | Email:     [EMAIL PROTECTED]||
++===========================================+============================++


> -----Original Message-----
> From: Kevin Williams [mailto:[EMAIL PROTECTED]]
> Sent: Friday, June 01, 2001 4:23 AM
> To: perl
> Subject: Intershop
>
>
> has anybody coded perl within Intershop and come across the statement
> "require Exporter"? If so could you please tell me what it means/does.
>
> Cheers,
>
> Sally
> (I am Sally and not Kevin)
>
>

Reply via email to