Skip Menu | will be shut down on March 1st, 2021.

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

Owner: Nobody in particular
Requestors: jasonk [...]

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

Subject: Rejecting non-references for no reason?
MIME-Version: 1.0
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Type: text/plain
Charset: utf8
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 583
Download (untitled) / with headers
text/plain 583b
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 );

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to