ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent-MP/MP.pm
(Generate patch)

Comparing AnyEvent-MP/MP.pm (file contents):
Revision 1.40 by root, Sat Aug 8 00:22:16 2009 UTC vs.
Revision 1.41 by root, Sat Aug 8 21:56:29 2009 UTC

546sub mon { 546sub mon {
547 my ($noderef, $port) = split /#/, shift, 2; 547 my ($noderef, $port) = split /#/, shift, 2;
548 548
549 my $node = $NODE{$noderef} || add_node $noderef; 549 my $node = $NODE{$noderef} || add_node $noderef;
550 550
551 my $cb = @_ ? $_[0] : $SELF || Carp::croak 'mon: called with one argument only, but $SELF not set,'; 551 my $cb = @_ ? shift : $SELF || Carp::croak 'mon: called with one argument only, but $SELF not set,';
552 552
553 unless (ref $cb) { 553 unless (ref $cb) {
554 if (@_) { 554 if (@_) {
555 # send a kill info message 555 # send a kill info message
556 my (@msg) = @_; 556 my (@msg) = ($cb, @_);
557 $cb = sub { snd @msg, @_ }; 557 $cb = sub { snd @msg, @_ };
558 } else { 558 } else {
559 # simply kill other port 559 # simply kill other port
560 my $port = $cb; 560 my $port = $cb;
561 $cb = sub { kil $port, @_ if @_ }; 561 $cb = sub { kil $port, @_ if @_ };

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines