NAME

Test::Smoke::Util::Execute - Run a command and return its output.

SYNOPSIS

use Test::Smoke::Util::Execute;

my $ex = Test::Smoke::Execute->new(
    verbose   => $level,
    command   => $command,
    arguments => [@arguments],
);
my $output = eval { $ex->run() };
if (my $error = $@) {
    croak("Error running $command: $error");
}

DESCRIPTION

Test::Smoke::Util::Execute->new(%arguments)

Instantiate an object of this class

Arguments

  • verbose => [0, 1, 2]

  • command => $command_to_pass_to_qx

Returns

The instantiated object.

$executer->run()

Run the command with backticks.

Arguments

None

Returns

Context aware list or scalar.

If any error occured, $self->exitcode is set.

$executer->exitcode

Getter that returns the exitcode.

$executer->verbose

Accessor that returns the verbose.

$executer->arguments

Accessor that returns the arguments.

STUFF

(c) MMXIII - Abe Timmerman <abeltje@cpan.org>

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

See:

  • http://www.perl.com/perl/misc/Artistic.html

  • http://www.gnu.org/copyleft/gpl.html

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.