--- AnyEvent-MP/MP.pm 2009/08/07 22:55:18 1.38 +++ AnyEvent-MP/MP.pm 2009/08/08 00:22:16 1.40 @@ -621,8 +621,9 @@ permissible to immediately start sending messages or monitor the port. After the port has been created, the init function is -called. This fucntion must be a fully-qualified function name -(e.g. C). +called. This function must be a fully-qualified function name +(e.g. C). To specify a function in the main +program, use C<::name>. If the function doesn't exist, then the node tries to C the package, then the package above the package and so on (e.g. @@ -671,6 +672,9 @@ my $id = "$RUNIQ." . $ID++; + $_[0] =~ /::/ + or Carp::croak "spawn init function must be a fully-qualified name, caught"; + ($NODE{$noderef} || add_node $noderef) ->send (["", "AnyEvent::MP::_spawn" => $id, @_]);