| IPC-ShellCmd documentation | Contained in the IPC-ShellCmd distribution. |
IPC::ShellCmd::Generic - Chain a generic wrapper-type command
$cmd_obj->chain_prog(
IPC::ShellCmd::Generic->new(
Prog => 'time',
Args => ["-p"],
)
);
The only external method for this is the constructor. This sets up the various arguments that are going to be used to generate the command-line.
Other methods on this are used by IPC::ShellCmd, but it should only ever be used inside of the chain_prog method on a IPC::ShellCmd object.
The program to run, eg. tsocks, socksify, time
A set of arguments to the program before passing the command and args
I don't know of any, but that doesn't mean they're not there.
See IPC::ShellCmd for authors.
See IPC::ShellCmd for the license.
| IPC-ShellCmd documentation | Contained in the IPC-ShellCmd distribution. |
package IPC::ShellCmd::Generic; use strict; use Carp qw(croak); use base qw(IPC::ShellCmd::ShBase);
sub new { my $package = shift; my %args = @_; croak "Must specify a Prog argument" unless defined $args{Prog}; my $self = bless { args => \%args }, $package; return $self; } sub chain { my $self = shift; my $cmd = shift; my $args = shift; my $cmd_string = $self->generate_sh_cmd($cmd, $args); my @generic = ($self->{args}->{Prog}); push (@generic, @{$self->{args}->{Args}}) if(defined $self->{args}->{Args}); push (@generic, "sh", "-c", $cmd_string); return @generic; }
1;