Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
Multiplex::CMD(3)     User Contributed Perl Documentation    Multiplex::CMD(3)

NAME
       Multiplex::CMD -	Multiplexed Fork Client

VERSION
       This documentation describes version 0.03

SYNOPSIS
	use Multiplex::CMD;

	my @target = qw( host1 host2 ... );

	my %config =
	(
	    timeout => 30,
	    buffer => 'bob loblaw',
	    ## {} is replaced with each	of the individual 'targets'.
	    ## also assuming no	SSH password/pass phrase challenge.
	    command => 'ssh {} wc',
	);

	my $client = Multiplex::CMD->new( map {	$_ => \%config } @target );

	my %option =
	(
	    timeout => 300,	## global timeout in seconds
	    max_buf => 1024,	## max number of bytes in each read buffer
	    multiplex => 100,	## max number of children processes
	    verbose => *STDERR	## report progress to STDERR
	);

	if ( $client->run( %option ) )
	{
	    my $result = $client->result() || {};
	    my $error =	$client->error() || {};
	}
	else
	{
	    print $client->error();
	}

DESCRIPTION
   run
       Launches	client with the	following parameter.  Returns 1	if successful.
       Returns 0 otherwise.

	timeout	  : global timeout in seconds
	max_buf	  : max	number of bytes	in each	read buffer
	multiplex : max	number of children processes
	verbose	  : report progress to a file handle opened for	write

   result()
       Returns undef if	no result. Returns a HASH reference indexed by
       'target'.

   error()
       Returns undef if	no error.  Returns a string if a global	error
       occurred, else if errors	occurred with children processes, returns a
       HASH reference indexed by 'target'.

SEE ALSO
       IPC::Open3 and IO::Poll

AUTHOR
       Kan Liu

COPYRIGHT and LICENSE
       Copyright (c) 2010. Kan Liu

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

perl v5.32.1			  2011-01-13		     Multiplex::CMD(3)

NAME | VERSION | SYNOPSIS | DESCRIPTION | SEE ALSO | AUTHOR | COPYRIGHT and LICENSE

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=Multiplex::CMD&sektion=3&manpath=FreeBSD+13.0-RELEASE+and+Ports>

home | help