Subject: | Error with statusdat_demo.pl |
When I ran the statusdat_demo.pl against status.dat file...I received
the following errors...
Use of uninitialized value in subroutine entry at
/usr/lib/perl5/site_perl/5.8.8/Nagios/StatusLog.pm line 365, <GEN0> line
113437.
Undefined subroutine &main:: called at
/usr/lib/perl5/site_perl/5.8.8/Nagios/StatusLog.pm line 365, <GEN0> line
113437.
Under line 365 of StatusLog.pm I see the following text underlined with
^ characters below...
Not sure what is wrong...I'm using Perl 5.8.8 and Nagios 3.2.3 under
Redhat 64 bit.
#Drop comments if we don't need them as it should speed things up a
little bit.
#Comment out the line below if you do want to keep comments
$file =~ s/#.*\n//mg;
$file =~ s/[\r\n]+\s*/\n/g; # clean up whitespace and newlines
while ( $file =~ /$entry_re/g ) {
( my $type, my $text ) = ( $1, $2 );
my %item = map { split /\s*=\s*/, $_, 2 } split /\n/, $text;
$handlers{$type}->( \%item );
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
}
close($log_fh);
1;
}