Help with @INC

Help with @INC

am 24.02.2007 16:25:52 von Carl Sajjan

------_=_NextPart_001_01C75828.109965BD
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

=20

Dear List,

=20

=20

I am chaged with setting up LDAP monitoring using some
tool. I came across this Look.pl utility. But when I try to run this
file I got the error... I am a newbie to PERL.

=20

perl look.pl

/usr/perl5/5.6.1/lib//sun4-solaris-64int/usr/perl5/5.6.1/lib //usr/iplane
t/perl5/lib/site/Mozilla/LDAP//usr/ds/v5.2/nsPerl5.005_03/li b/site/Mozil
la/LDAP//usr/ds/v5.2/nsPerl5.006_01/lib/site/Mozilla/LDAP//u sr/perl5/5.6
..1/lib/sun4-solaris-64int/usr/perl5/5.6.1/lib/usr/perl5/sit e_perl/5.6.1/
sun4-solaris-64int/usr/perl5/site_perl/5.6.1/usr/perl5/site_ perl/usr/per
l5/vendor_perl/5.6.1/sun4-solaris-64int/usr/perl5/vendor_per l/5.6.1/usr/
perl5/vendor_perl.

=20

Can't locate object method "new" via package "Mozilla::LDAP::Conn"
(perhaps you forgot to load "Mozilla::LDAP::Conn"?) at look.pl line 767.

=20

=20

Thing is I have this Conn.pm in these many locations.

=20

/usr/perl5/5.6.1/lib/Conn.pm

/usr/iplanet/perl5/lib/site/Mozilla/LDAP/Conn.pm

/usr/ds/v5.2/nsPerl5.005_03/lib/site/Mozilla/LDAP/Conn.pm

/usr/ds/v5.2/nsPerl5.006_01/lib/site/Mozilla/LDAP/Conn.pm

=20

=20

Where am I going wrong I tried adding the path in Use lib ...

=20

=20

Please help me out.

=20

=20

TIA

=20

Carl

............................................................ .............
..............................

=20

The wise want love; and those who love want wisdom.

--Percy Bysshe Shelley=20

=20


------_=_NextPart_001_01C75828.109965BD--

Re: Help with @INC

am 24.02.2007 19:02:06 von Ken Foskey

On Sat, 2007-02-24 at 20:55 +0530, Carl Sajjan wrote:

> Can't locate object method "new" via package "Mozilla::LDAP::Conn"
> (perhaps you forgot to load "Mozilla::LDAP::Conn"?) at look.pl line 767.

do you have this near the top of your script?

use Mozilla::LDAP::Conn;


--
Ken Foskey
FOSS developer


--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/

Re: Help with @INC

am 24.02.2007 19:11:22 von ROB.DIXON

Carl Sajjan wrote:
>
> I am chaged with setting up LDAP monitoring using some tool. I came across
> this Look.pl utility. But when I try to run this file I got the error...
> I am a newbie to PERL.
>
> perl look.pl
>
> /usr/perl5/5.6.1/lib//sun4-solaris-64int
> /usr/perl5/5.6.1/lib/
> /usr/iplanet/perl5/lib/site/Mozilla/LDAP/
> /usr/ds/v5.2/nsPerl5.005_03/lib/site/Mozilla/LDAP/
> /usr/ds/v5.2/nsPerl5.006_01/lib/site/Mozilla/LDAP/
> /usr/perl5/5.6.1/lib/sun4-solaris-64int
> /usr/perl5/5.6.1/lib
> /usr/perl5/site_perl/5.6.1/sun4-solaris-64int
> /usr/perl5/site_perl/5.6.1
> /usr/perl5/site_perl
> /usr/perl5/vendor_perl/5.6.1/sun4-solaris-64int
> /usr/perl5/vendor_perl/5.6.1
> /usr/perl5/vendor_perl.
>
> Can't locate object method "new" via package "Mozilla::LDAP::Conn"
> (perhaps you forgot to load "Mozilla::LDAP::Conn"?) at look.pl line 767.
>
>
> Thing is I have this Conn.pm in these many locations.
>
> /usr/perl5/5.6.1/lib/Conn.pm
>
> /usr/iplanet/perl5/lib/site/Mozilla/LDAP/Conn.pm
>
> /usr/ds/v5.2/nsPerl5.005_03/lib/site/Mozilla/LDAP/Conn.pm
>
> /usr/ds/v5.2/nsPerl5.006_01/lib/site/Mozilla/LDAP/Conn.pm
>
>
> Where am I going wrong I tried adding the path in Use lib ...

If you have the line

use Mozilla::LDAP::Conn;

in your program, Perl will look in all the paths in @INC for a file with the
relative path

Mozilla/LDAP/Conn.pm

so the first of these is no use at all as it doesn't have directories Mozilla
and LDAP in the path. The rest are fine, except that none of the locations are
in @INC. If you add any of

/usr/iplanet/perl5/lib/site
/usr/ds/v5.2/nsPerl5.005_03/lib/site
/usr/ds/v5.2/nsPerl5.006_01/lib/site

to @INC then Perl will find the module correctly. Which is the best place to
use depends on the way your system is set up and where other modules are kept.

HTH,

Rob




--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/