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

NAME

PTools::Proc::Backtick - Simple OO interface to system commands

VERSION

This document describes version 0.03, released Feb 15, 2003.

SYNOPSIS

     $cmdObj = run PTools::Proc::Backtick("/bin/echo","echo this");

     ($stat,$err)= $cmdObj->status();

 or  ($stat,$err,$cmdObj) = run PTools::Proc::Backtick( "grep", "foo", $fileName );

     $commandOut = $cmdObj->result();

 or  $stat  = $cmdObj->stat();     # status number returned in scalar context
     ($err) = $cmdObj->stat();     # error message returned in array context

     ($err) = $cmdObj->err();

DESCRIPTION

A simple object oriented interface to Perl's backtick functionality.

Constructor

new

The new method is optional. The run method will also return a newly constructed object.

Methods

run ( Command [, Args ] )

Run a system command via Perl's backtick functionality.

Command

Specify the system command which is to be run.

Args

Supply any additional command-line parameter(s) for the system command.

See Synopsis section for examples.

result

Collect any output resulting from the execution of Command. This will contain results from both STDOUT and STDERR.

status
stat
err

Collect the status resulting from the execution of Command. When the status code is non-zero, an error message is also returned. See Synopsis section for examples.

INHERITANCE

None currently.

SEE ALSO

See PTools::Proc::Status.

AUTHOR

Chris Cobb [no dot spam at ccobb dot net]

COPYRIGHT

Copyright (c) 2002-2007 by Chris Cobb. All rights reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.