Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Event-Notify CPAN distribution.

Report information
The Basics
Id: 33911
Status: new
Priority: 0/
Queue: Event-Notify

People
Owner: Nobody in particular
Requestors: jasonk [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.00004
Fixed in: (no value)



Subject: Rejecting non-references for no reason?
I was trying to use Event::Notify in a situation where I wanted to register packages, and have a class method called on them when the notification fired, but it seems I can't do that because of this code in Event::Notify->register_event: if (! $ref) { Carp::croak( "Non-ref observer passed. Expected an object or a CODE ref" ); } Which prevents you from using Event::Notify in this way, for no apparent reason. In fact if I just remove the croak, then it works just as I would have expected it to.... my $notify = Event::Notify->new; MyClass->register( $notify );