… | |
… | |
356 | |
356 | |
357 | $self->[0](sub { |
357 | $self->[0](sub { |
358 | my $fh = shift |
358 | my $fh = shift |
359 | or die "AnyEvent::Fork::Remote: create callback failed"; |
359 | or die "AnyEvent::Fork::Remote: create callback failed"; |
360 | |
360 | |
361 | my $code = 'BEGIN {' . $self->[1] . "}\n" |
361 | my $code = 'BEGIN { $0 = "AnyEvent::Fork::Remote of another process"; ' . $self->[1] . "}\n" |
362 | . 'syswrite STDOUT, ' . (sq $magic0) . '^' . (sq $magic1) . ';' |
362 | . 'syswrite STDOUT, ' . (sq $magic0) . '^' . (sq $magic1) . ';' |
363 | . '{ sysread STDIN, my $dummy, 1 }' |
363 | . '{ sysread STDIN, my $dummy, 1 }' |
364 | . "\n$func*STDIN," . (aq @{ $self->[2] }) . ';' |
364 | . "\n$func*STDIN," . (aq @{ $self->[2] }) . ';' |
365 | . "\n__END__\n"; |
365 | . "\n__END__\n"; |
366 | |
366 | |