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

Comparing AnyEvent-Fork-Remote/Remote.pm (file contents):
Revision 1.5 by root, Sun Apr 28 15:36:30 2013 UTC vs.
Revision 1.6 by root, Sun Jul 13 00:14:58 2014 UTC

71We use C<new_execp> to execute the first F<perl> found in the PATH. You'll 71We use C<new_execp> to execute the first F<perl> found in the PATH. You'll
72have to make sure there is one for this to work. The perl does not 72have to make sure there is one for this to work. The perl does not
73actually have to be the same perl as the one running the example, and it 73actually have to be the same perl as the one running the example, and it
74doesn't need to have any modules installed. 74doesn't need to have any modules installed.
75 75
76The reason we have to specif< C<perl> twice is that the first argument to 76The reason we have to specify C<perl> twice is that the first argument to
77C<new_execp> (and also C<new_exec>) is the program name or path, while 77C<new_execp> (and also C<new_exec>) is the program name or path, while
78the remaining ones are the arguments, and the first argument passed to a 78the remaining ones are the arguments, and the first argument passed to a
79program is the program name, so it has to be specified twice. 79program is the program name, so it has to be specified twice.
80 80
81Finally, the standard example, send some numbers to the remote function, 81Finally, the standard example, send some numbers to the remote function,
236 236
237sub new_from_fh { 237sub new_from_fh {
238 my ($class, @fh) = @_; 238 my ($class, @fh) = @_;
239 239
240 $class->new (sub { 240 $class->new (sub {
241 shift @fh 241 my $fh = shift @fh
242 or Carp::croak "AnyEvent::Fork::Remote::new_from_fh does not support fork"; 242 or Carp::croak "AnyEvent::Fork::Remote::new_from_fh does not support fork";
243
244 $_[0]($fh);
243 }); 245 });
244} 246}
245 247
246sub _new_exec { 248sub _new_exec {
247 my $p = pop; 249 my $p = pop;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines