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.6 by root, Sun Jul 13 00:14:58 2014 UTC vs.
Revision 1.7 by root, Sat May 21 07:37:04 2016 UTC

125use Carp (); 125use Carp ();
126use Errno (); 126use Errno ();
127 127
128use AnyEvent (); 128use AnyEvent ();
129 129
130our $VERSION = 0.2; 130our $VERSION = '1.0';
131 131
132# xored together must start and and with \n 132# xored together must start and and with \n
133my $magic0 = "Pdk{6y[_zZ"; 133my $magic0 = "Pdk{6y[_zZ";
134my $magic1 = "Z^yZ7~i=oP"; 134my $magic1 = "Z^yZ7~i=oP";
135 135
426 my $fh = shift 426 my $fh = shift
427 or die "AnyEvent::Fork::Remote: create callback failed"; 427 or die "AnyEvent::Fork::Remote: create callback failed";
428 428
429 my $owner = length $ENV{HOSTNAME} ? "$ENV{HOSTNAME}:$$" : "*:$$"; 429 my $owner = length $ENV{HOSTNAME} ? "$ENV{HOSTNAME}:$$" : "*:$$";
430 430
431 my $code = 'BEGIN { $0 = ' . (sq "$func of $owner") . '; ' . $self->[1] . "}\n" 431 my $code = 'BEGIN { $0 = ' . (sq "$owner $func") . '; ' . $self->[1] . "}\n"
432 . 'syswrite STDOUT, ' . (sq $magic0) . '^' . (sq $magic1) . ';' 432 . 'syswrite STDOUT, ' . (sq $magic0) . '^' . (sq $magic1) . ';'
433 . '{ sysread STDIN, my $dummy, 1 }' 433 . '{ sysread STDIN, my $dummy, 1 }'
434 . "\n$func*STDIN," . (aq @{ $self->[2] }) . ';' 434 . "\n$func*STDIN," . (aq @{ $self->[2] }) . ';'
435 . "\n__END__\n"; 435 . "\n__END__\n";
436 436

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines