in reply to Understanding and building modules

To use a module, first you need to load it. Soo, your code should be:
use Mapps::Auth ; $auth = new Mapps::Auth->auth($uname, $passwd); ...
Note that your module need to be in some @INC path. To see what directories your Perl interpreter is lookin for modules, get the output of this code:
foreach my $INC_i ( @INC ) { print "$INC_i\n" ; }
Here the output is:
C:/Perl/lib C:/Perl/site/lib .

Graciliano M. P.
"Creativity is the expression of the liberty".

Replies are listed 'Best First'.
Re: Re: Undertanding and building modules
by neilwatson (Priest) on Apr 03, 2004 at 21:24 UTC
    Yes, I do have use Mapps::Auth; and it is loaded in a place where perl can find it.

    Neil Watson
    watson-wilson.ca

      Do you in fact have a directory "Mapps" containing a module "Auth.pm", because as far as i now this is where Perl will look for it (e.g. current directory).
      To me it really looks like Perl can not find the module at all.

      You also could include a use diagnostics; in your code or take everything away but the new method and try to load the module and just call new.

      I also always bless the self hash inside the new method, because otherwise you later may get an error like can't call method "auth" on unblessed reference