Dear Monks,
I have a perfectly working perl/Tk script that we use for network management. It runs on Centos 5.6 and perl version is 5.8.8
I installed a new PC running Centos 5.7 and perl 5.8.8. I made sure all perl modules the script needs are installed. But I keep on getting the following error on the new machine:
Unable to create sub named "" at /usr/lib/perl5/site_perl/5.8.8/i386-l
+inux-thread-multi/AnyEvent.pm line 1488.
The lines in the script relevant to this are:
my $inotify = new Linux::Inotify2 or die "unable to create new inotify
+ object: $!";
# add watchers --watch the snmptrapd.log file
$watchObject = $inotify->watch ("/var/log/snmptrapd.log", IN_MODIFY, \
+&processTrap);
$inotify_w = AnyEvent->io (
fh => $inotify->fileno,
poll => 'r',
cb => sub {
$inotify->poll ;
},
);
MainLoop;
The sub processTrap is defined.If I comment the
$inotify_w= AnyEvent->io (...
line, the code does not give an error and quit. But obviously I need that line.
Any wisdom is appreciated...