--- AnyEvent-MP/MP.pm 2012/03/09 19:07:53 1.131 +++ AnyEvent-MP/MP.pm 2012/03/10 20:34:11 1.132 @@ -400,15 +400,15 @@ sub rcv($@); -sub _kilme { +my $KILME = sub { die "received message on port without callback"; -} +}; sub port(;&) { my $id = $UNIQ . ++$ID; my $port = "$NODE#$id"; - rcv $port, shift || \&_kilme; + rcv $port, shift || $KILME; $port } @@ -993,6 +993,9 @@ respectively. If no keys have changed then the array reference might be C or even missing. +If not called in void context, a guard object is returned that, when +destroyed, stops the monitor. + The family hash reference and the key arrays belong to AnyEvent::MP and B by the callback. When in doubt, make a copy.