Scroll to navigation

Sys::VirtConvert::ExecHelper(3) User Contributed Perl Documentation Sys::VirtConvert::ExecHelper(3)

NAME

Sys::VirtConvert::ExecHelper - Execute a command with output suppression

SYNOPSIS

 use Sys::VirtConvert::ExecHelper;
 $eh = Sys::VirtConvert::ExecHelper->run('rpm', '-V', 'bash');
 if($eh->status() != 0) {
     warn $eh->output();
 }

DESCRIPTION

Sys::VirtConvert::ExecHelper is a substitute for system() when you don't want any command output. Sys::VirtConvert::ExecHelper does, however, make STDOUT and STDERR available in a combined stream if it is required, for example because the executed command failed.

METHODS

Run @command, which is an array containing the command and its arguments.

The command will be executed immediately. ExecHelper will block until the command exits.

Return the exit status of the executed command.
Return the combined stdout and stderr of the command.

WARNING: This command puts the output in a string in memory. Don't use this if the output could be large.

COPYRIGHT

Copyright (C) 2009 Red Hat Inc.

LICENSE

Please see the file COPYING.LIB for the full license.

SEE ALSO

virt-v2v(1), <http://libguestfs.org/>.

2013-12-03 perl v5.10.1