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

I've installed OTRS, an open source web based perl trouble ticket support desk. It seems great, but is having one tiny error -- when I try to respond to trouble tickets, I get this error:

Can't locate object method "new" via package "Net::DNS::Resolver" at /opt/otrs/bin/cgi-bin/../../Kernel/System/CheckItem.pm line 154.

I looked and the section of code at line 154 is as follows:

my $Resolver = Net::DNS::Resolver->new(); if ($Resolver) { # check if extra nameserver need to be used my $Nameserver = $Self->{ConfigObject}->Get('CheckMXRecord +::Nameserver'); if ($Nameserver) { $Resolver->nameservers($Nameserver); }


I'm not looking to change the code per se. Just trying to assess what the problem is, and whether tweaking server settings would help.

I'm a perl newbie. Apologies if this is obvious.

Replies are listed 'Best First'.
Re: Error with Net::DNS::Resolver
by afoken (Chancellor) on Jan 23, 2010 at 20:05 UTC

    Your code should contain something like use Net::DNS, as explained in the manual. You may get another error (Can't locate Net::DNS in @INC ...) when Net::DNS was not properly installed.

    Alexander

    --
    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
Re: Error with Net::DNS::Resolver
by SilasTheMonk (Chaplain) on Jan 23, 2010 at 20:16 UTC
    It seems unlikely that publically available piece of software would forget to do "user Net::DNS::Resolver;". It seems more likely to me that you need to install this module on your system.