Infinite Loop with Glib::IO->add_watch()



Hi there,

when I'm using add_watch() to register a watch on a filehandle, the 
callback associated with it is called infinitely:

     Glib::IO->add_watch(fileno(\*READHANDLE),
         'in', sub { print "got something!\n"; 1; });

prints out

     got something!
     got something!
     got something!
     ...

even if there's only one event. Is there a way to prevent this without 
returning 0 in the callback and therefore disabling the watch?

-- 
-- Mike
Mike Schilli
b2b perlmeister com




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]