App-Greple-xp
view release on metacpan or search on metacpan
}
sub run {
my $obj = shift;
use IO::File;
my $pid = (my $fh = new IO::File)->open('-|') // die "open: $@\n";
if ($pid == 0) {
open STDERR, ">&STDOUT";
greple(@{$obj->{OPTION}});
exit 1;
}
binmode $fh, ':encoding(utf8)';
$obj->{RESULT} = do { local $/; <$fh> };
my $child = wait;
$child != $pid and die "child = $child, pid = $pid";
$obj->{STATUS} = $?;
$obj;
}
sub status {
my $obj = shift;
$obj->{STATUS} >> 8;
}
( run in 0.774 second using v1.01-cache-2.11-cpan-3cd7ad12f66 )