Command-Run
view release on metacpan or search on metacpan
lib/Command/Run.pm view on Meta::CPAN
$obj->update(@_);
if (my $ref = $obj->{STDOUT_REF}) {
$$ref = $obj->data;
}
if (my $ref = $obj->{STDERR_REF}) {
$$ref = $obj->error;
}
return $obj->result;
}
sub update {
use Time::localtime;
my $obj = shift;
my @command = $obj->command;
if (@command) {
$obj->{RESULT} = $obj->execute(\@command, @_);
# Store stdout in temp file for path access
my $fh = $obj->fh;
$fh->seek(0, 0) or die "seek: $!\n";
$fh->truncate(0) or die "truncate: $!\n";
$fh->print($obj->{RESULT}->{data} // '');
( run in 0.779 second using v1.01-cache-2.11-cpan-39bf76dae61 )