AnyEvent-Fork-Remote
view release on metacpan or search on metacpan
Carp::croak "send_fh is not supported on AnyEvent::Fork::Remote objects";
}
=item $proc = $proc->eval ($perlcode, @args)
Quite the same as the same method of L<AnyEvent::Fork>.
=cut
# quote a binary string as a perl scalar
sub sq($) {
my $s = shift;
$s =~ /'/
or return "'$s'";
$s =~ s/(\x10+)/\x10.'$1'.q\x10/g;
"q\x10$s\x10"
}
# quote a list of strings
sub aq(@) {
"(" . (join ",", map sq $_, @_) . ")"
}
sub eval {
my ($self, $perlcode, @args) = @_;
my $linecode = $perlcode;
$linecode =~ s/\s+/ /g; # takes care of \n
$linecode =~ s/"/''/g;
substr $linecode, 70, length $linecode, "..." if length $linecode > 70;
( run in 0.867 second using v1.01-cache-2.11-cpan-65fba6d93b7 )