Alt-Acme-Math-XS-CPP
view release on metacpan or search on metacpan
inc/Capture/Tiny.pm view on Meta::CPAN
#--------------------------------------------------------------------------#
# private subs
#--------------------------------------------------------------------------#
sub _start_tee {
my ($which, $stash) = @_; # $which is "stdout" or "stderr"
# setup pipes
$stash->{$_}{$which} = IO::Handle->new for qw/tee reader/;
pipe $stash->{reader}{$which}, $stash->{tee}{$which};
# _debug( "# pipe for $which\: " . _name($stash->{tee}{$which}) . " " . fileno( $stash->{tee}{$which} ) . " => " . _name($stash->{reader}{$which}) . " " . fileno( $stash->{reader}{$which}) . "\n" );
select((select($stash->{tee}{$which}), $|=1)[0]); # autoflush
# setup desired redirection for parent and child
$stash->{new}{$which} = $stash->{tee}{$which};
$stash->{child}{$which} = {
stdin => $stash->{reader}{$which},
stdout => $stash->{old}{$which},
stderr => $stash->{capture}{$which},
};
# flag file is used to signal the child is ready
$stash->{flag_files}{$which} = scalar tmpnam();
# execute @cmd as a separate process
inc/Parse/RecDescent.pm view on Meta::CPAN
if (defined $itemposfirst)
{
Parse::RecDescent::Production::_update_itempos($_itempos, $itemposfirst, undef, [qw(from)]);
}
$_[1] = $text;
return [@tokens];
}
sub set_autoflush {
my $orig_selected = select $_[0];
$| = 1;
select $orig_selected;
return;
}
# ERROR REPORTING....
sub _write_ERROR {
my ($errorprefix, $errortext) = @_;
return if $errortext !~ /\S/;
$errorprefix =~ s/\s+\Z//;
local $^A = q{};
( run in 1.099 second using v1.01-cache-2.11-cpan-49f99fa48dc )