Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Can't locate object method "new" via package

Reply
Thread Tools

Can't locate object method "new" via package

 
 
smilesonisamal@gmail.com
Guest
Posts: n/a
 
      12-20-2013
Hi all,
I am finding an issue in perl v5.10.1. I am getting the following issue.
I have added the path in @INC in my script.

Error : Can't locate object method "new" via package

Can anybody help me in this regard?

Regards
Pradeep


 
Reply With Quote
 
 
 
 
George Mpouras
Guest
Posts: n/a
 
      12-20-2013
# try


use strict;
use warnings;
use FindBin;
use lib $FindBin::Bin;
use MyModule;
....



 
Reply With Quote
 
 
 
 
Jürgen Exner
Guest
Posts: n/a
 
      12-20-2013
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
>Hi all,
> I am finding an issue in perl v5.10.1. I am getting the following issue.
>I have added the path in @INC in my script.
>
>Error : Can't locate object method "new" via package
>
>Can anybody help me in this regard?


As has been customary for decades please post a small, self-contained
program that exhibits the problem and that other people can run and
test.

jue
 
Reply With Quote
 
Rainer Weikusat
Guest
Posts: n/a
 
      12-20-2013
(E-Mail Removed) writes:
> Hi all,
> I am finding an issue in perl v5.10.1. I am getting the following issue.
> I have added the path in @INC in my script.
>
> Error : Can't locate object method "new" via package
>
> Can anybody help me in this regard?


This statement is a little cryptic. Let's assume that the package name
is Arthur. In this case, the error message

Error : Can't locate object method "new" via package Arthur
(perhaps you forgot to load Arthur)

means there's a call to a method named new (usually a constructor)
using Arthur as invocant, eg

my $dent = Arthur->new();

but the symbol table of the package Arthur didn't contain an entry for a
subroutine named new. Usually, the cause is just what the error message
suggests: It wasn't loaded, a statement a la

use Arthur;

is missing. You should provide some more information about your problem
if that wasn't the cause.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can not locate object method "AddCell" via package "Spreadsheet:: Arindam Perl Misc 10 07-19-2010 09:20 PM
"Can't locate object method "PV" via package "B::SPECIAL"" kj Perl Misc 3 10-20-2007 05:02 PM
Can't locate object method "host" via package "URI::_foreign" vkinger@hotmail.com Perl Misc 1 06-01-2007 05:35 PM
Net::FTP can't locate object method "new" Henry Salvia Perl Misc 2 01-01-2006 07:11 PM
Can't locate object method "first" via package "attempt" (perhaps you forgot to load "attempt"?) at .... GMI Perl Misc 3 06-19-2005 10:44 PM



Advertisments