LinuxSA Mailing list archives

Index: [thread] [date] [subject] [author] [stats]
  From: Toby Corkindale <tjcorkin@sa.pracom.com.au>
  To  : David Lloyd <lloy0076@rebel.net.au>
  Date: Thu, 31 May 2001 16:06:10 +0930 (CST)

Re: PERL Question

Curiously, this worked fine for me.
Perl version 5.6.0, on Linux..
I can only surmise something else is wrong here..

my header of the module looked like

package WDB::MyModule;

BEGIN {
   use Exporter   ();
   use vars       qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
   # set the version for version checking
   $VERSION     = 1.00;
   @ISA         = qw(Exporter);
   @EXPORT      = qw(faked);
   %EXPORT_TAGS = ( );     # eg: TAG => [ qw!name1 name2! ],
   # your exported package globals go here,
   # as well as any optionally exported functions
   @EXPORT_OK   = qw(setup);
}

how about yours?

On Thu, 31 May 2001, David Lloyd wrote:

>
> I have a module called wdbMain which has this:
>
> (wdbMain.pm)
> ...
> @ISA=qw(Exporter);
> @EXPORT_OK=qw(setup...);
> ...
>
> It's in /usr/lib/perl5/site_perl/i386-linux/WDB/
>
> Now I have:
>
> ...
> #! /usr/bin/perl
>
> use WDB::wdbMain qw(setup);
>
> print setup();
> ...
>
> However, perl 5.6 complains that:
>
> &main::setup ... doesn't exist
>
> I thought that my "use" would bring "setup" into my namespace.
>
> I've discovered that replacing setup() with wdbMain::setup() works
> without a glitch. I've tried substituting "setup" with foo, camel and
> yodling just in case I've clobbered some preexisting function called
> "setup"; in all these cases the same behaviour occurs.
>
>
> I know there's a reason why this is so, but I just can't figure it out
> at the moment.
>
> DSL
>
>

-- 
 Toby Corkindale
 UNIX Developer, Core Tech R&D
 Technology SA, Pracom Ltd
 288 Glen Osmond Road
 Fullarton,	5063
 South Australia
 Tel: +61 8 8202 9075
 Fax: +61 8 8202 9001
 mailto:Toby.Corkindale@sa.pracom.com.au
 http://www.sa.pracom.com.au/

                  PRIVILEGED - PRIVATE AND CONFIDENTIAL

   Privileged/Confidential Information may be contained in this message.
   If you are not the addressee indicated in this message, you may not
   copy or deliver this message to anyone.  In such case, you should
   destroy this message and notify the sender by reply email. Opinions,
   conclusions and other information in this message that do not relate
   to the official business of this organisation shall be understood as
   neither given nor endorsed by it.



-- 
LinuxSA WWW: http://www.linuxsa.org.au/  IRC: #linuxsa on irc.linux.org.au
To unsubscribe from the LinuxSA list:
  mail linuxsa-request@linuxsa.org.au with "unsubscribe" as the subject


Index: [thread] [date] [subject] [author] [stats]
Return to the LinuxSA Mailing List Information Page