Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I've been working with a perl tcp server and hit a brick wall. I made some trivial tweak which broke it, but when I undid the change it stays broken. Exaspirated I deleted everything and reinstalled but strangely get the same error, which didn't happen before on a fresh install. I even tried installing previous version to no avail.

The error:

Can't locate object method "new" via package "User" (perhaps you forgot to load "User"?) at line 173.

Line 173:

my $user = User->new($this);

I have confirmed that the script says "use User;" and that package User contains method "new". I don't understand what could cause the error to persist despite reinstalling fresh code. Appreciate any guidance in solving this problem. Thank you.

v5.6.1 built for i386-linux

Replies are listed 'Best First'.
Re: odd problem with object method
by PodMaster (Abbot) on Nov 30, 2003 at 18:59 UTC
    Maybe because the User module doesn't have a method called new? The only User module i know of it the one on cpan, and that one doesn't have new
    E:\>perl -MUser -e"die User->Home()" E:\Documents and Settings\theuser at -e line 1.

    update: um, what I mean to say is the User module which is actually getting used does't have a method called new (meaning you're not useing the module you think you are -- examine $INC{'User.pm'})

    MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
    I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
    ** The third rule of perl club is a statement of fact: pod is sexy.

      ++ PodMaster! Thank you.