Pick-TCL
view release on metacpan or search on metacpan
0.06 2014-07-06
Add option for the caller to specify a timeout at object
instantiation time (only when Pick is remote).
0.05 2014-05-03
Add methods for asynchronous execution (spawn, is_ready, output,
outputraw, partialoutput, partialoutputraw)
0.04 2014-01-06
Update dependencies in Makefile.PL.
Add fallback to getlogin() for systems without a working getpwuid()
for defaulting USER when neither USER nor SSHUSER is specified.
0.03 2014-01-05
Move dependence on Test::More from PREREQ_PM to BUILD_REQUIRES
and add IPC::Run to BUILD_REQUIRES (this rather defeats the
purpose of falling back to Net::OpenSSH for a local target VM
when IPC::Run is missing; but in the absence of any way to
define an OR relationship between modules listed in BUILD_REQUIRES
it seems the best compromise, since IPC::Run is far more commonly
found than Net::OpenSSH).
lib/Pick/TCL.pm view on Meta::CPAN
# Check/set options
croak "Pick::TCL constructor options must be a balanced hash"
unless scalar(@_) % 2 == 0;
my %options = @_;
$options{'VM'} = 'pick0' unless defined($options{'VM'});
unless (defined($options{'USER'}))
{
# Default Pick username to remote Unix username if set
my $u = $options{'SSHUSER'};
# Otherwise local username
$u = eval { getpwuid($<); } unless defined($u);
# Handle platforms without a working getpwuid()
$u = getlogin() unless defined($u);
}
$options{'PICKBIN'} = '/usr/bin/ap' unless defined($options{'PICKBIN'});
$options{'OPTDATA'} = '-d' unless defined($options{'OPTDATA'});
$options{'OPTSILENT'} = '-s' unless defined($options{'OPTSILENT'});
$options{'OPTVM'} = '-n' unless defined($options{'OPTVM'});
if (defined($options{'TIMEOUT'}))
{
$options{'TIMEOUT'} = 0 + $options{'TIMEOUT'};
} else {
( run in 0.395 second using v1.01-cache-2.11-cpan-8d75d55dd25 )