Newbie Perl Module Problem

Darren Munday dazzer at
Wed Oct 26 12:54:07 UTC 2005

Hi All,

I'm having a problem running a Perl script (written by my colleague)
which uses the module Net::SNMP 

The module is installed but I'm suspecting for some reason it's not in
the correct location. My colleague installed the module and ran the
script using Debian with no problems but replicating it on Ubuntu is

Any ideas would be greatly received,

Thanks in advance,

Darren. :0)
Here's the first section of the script:

use strict;
use Net::SNMP;
use DBI;
use DBD::Pg qw(:pg_types);

my $community_string = "innovcom";
my $version = "2";
my $counter = 0;
my $ifOperStatus = ".";
my $ifInOctets = ".";
my $host = "";
my $port;
my @ports;
my %portcounters;

# Initialise "session" object with ip address and community string
my ($session, $error) = Net::SNMP->session(
					       Hostname => $host,
					       Community => $community_string,
					       Version => $version
die "Initialise session error: $error" unless ($session);
Here's the error:
Can't locate Net/ in @INC (@INC contains: 
/usr/local/lib/site_perl .) at ./ line 4.
BEGIN failed--compilation aborted at ./ line 4.
Here's a suggestion for a solution to a similar problem I found through
Google which uses a sym link. As with this problem, the "Net" directory
doesn't exist on my install either:
On Thu, 18 Sep 2003, Mike McClure wrote:
 >> does not appear to be in the correct place.  How did you install it?
 >> Anyway, this should fix your problem:
 >> cd /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi
 >> mkdir Net
 >> cd Net
 >> ln -s ../ .
The resulting error from following the suggestion above:
Can't locate object method "session" via package "Net::SNMP" (perhaps
you forgot to load "Net: :SNMP"?) at ./ line 19.

More information about the ubuntu-users mailing list