I'm wondering if there is an equivalent to Qt's signal/slot mechanism for Perl. I have looked into POE, but since it's huge, I couldn't find anything use开发者_JS百科ful.
Thank you in advance,
Perhaps you are looking for something like Object::Event, an API for registering and emitting events, mostly for AnyEvent, but I imagine you could use it elsewhere. Gtk2 also has a mechanism similar to QT's, especially combined with Glade XML, which lets you automatically map event slots|signals to perl object methods or functions. AnyEvent is a generic event loop which supports Gtk/Glib and POE, amongst others, and is much easier to grok than the large set of modules that is POE.
The concept is generally called Publish/Subscribe. The search result for pubsub
on CPAN gives you what you want.
精彩评论