The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

SmokeRunner::Multi::SafeRun - Run an external command safely in taint mode

VERSION

version 0.21

SYNOPSIS

  use SmokeRunner::Multi::SafeRun qw( safe_run );

  my $stdour;
  my $stderr;
  safe_run(
      command       => 'agitate',
      args          => [ '-file', $filename ],
      stdout_buffer => \$stdout,
      stderr_buffer => \$stderr,
  );

DESCRIPTION

This module provides a taint-safe wrapper around the run3() function from IPC::Run3.

FUNCTIONS

This module exports one optional subroutine:

safe_run(...)

This runs the specified command and captures its stdout and stderr streams in scalar references.

The command will be run in a taint-safe manner.

It expects the following parameters:

  • command

    The name to the command to run. The module internally uses File::Which to find a matching executable in the path. If none can be found, the function will die.

  • args

    This should be an array reference containing arguments to be passed to the command. This parameter is optional.

  • stdout_buffer

  • stderr_buffer

    These parameter should be references to scalars, which will be used to capture the output stream. You can pass the same scalar reference for both parameters.

    If you are not interested in a particular stream, pass a reference to undef - \undef for that parameter.

AUTHOR

Dave Rolsky, <autarch@urth.org>

BUGS

Please report any bugs or feature requests to bug-smokerunner-multi@rt.cpan.org, or through the web interface at http://rt.cpan.org. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

COPYRIGHT & LICENSE

Copyright 2007 LiveText, Inc., All Rights Reserved.

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

The full text of the license can be found in the LICENSE file included with this module.

AUTHORS

  • Dave Rolsky <autarch@urth.org>

  • Yanick Champoux <yanick@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2007 by LiveText, Inc..

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