Solved

load library

Posted on 2002-05-10
1
218 Views
Last Modified: 2010-03-05
Dear friends,

I meet a question in OO perl:

I have a module named:"LDCIDPORTController",
and i define constructor as:

#-------------------------------------
# constructor
# ------------------------------------
sub new
{
  my ($class, $config, $log ) = @_;
  my $self = {};

  $self->{config} = $config;
  $self->{log} = $log;

  bless ( $self, $class);
  return $self;
}


in my main programming, i load this lib by :
#!/tools/perl/bin/perl -I/export/home/yw5726/export/lduser/filter/lib:/export/home/yw5726/export/commonlib

but when i run it, got the error:

Can't locate object method "new" via package "LDCIDPORTController" at /export/home/yw5726/export/commonlib/Manager.pm line 75



Can someone give me some advice how to debug it?

Thanks ahead.

0
Comment
Question by:wangtian
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 1

Accepted Solution

by:
japhyRPI earned 50 total points
ID: 7002313
You need to more than just tell Perl where to find your module; you have to tell it to USE your module.  If you have a module Foo::Bar in /path/to/module/Foo/Bar.pm, then you'd do:

  use lib "/path/to/module";
  use Foo::Bar;
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question