X-Git-Url: https://defaria.com/gitweb/?a=blobdiff_plain;f=lib%2FRexec.pm;h=6db57353337256a178b313686f6c7098adb62d95;hb=8b0383ec715065d978e23e72864bcdbf0fc68ecc;hp=8d6a9a347ed3af222d87aa4d32d055560cc0e041;hpb=43bcea3777de207abb255b249028892826dfa4f2;p=clearscm.git diff --git a/lib/Rexec.pm b/lib/Rexec.pm index 8d6a9a3..6db5735 100644 --- a/lib/Rexec.pm +++ b/lib/Rexec.pm @@ -160,16 +160,18 @@ our @EXPORT = qw ( my @lines; -sub _debug ($) { +sub _debug ($) { my ($msg) = @_; - + my $logfile = "/tmp/rexex_debug.log"; - - open my $file, '>>', $logfile or die "Unable to open $logfile for writing - $!"; - + + open my $file, '>>', $logfile or croak "Unable to open $logfile for writing - $!"; + print $file "DEBUG: $msg\n"; - - close $file; + + close $file; + + return; } # _debug sub ssh { @@ -571,7 +573,7 @@ Returns: } # logoff sub new { - my ($class) = shift; + my ($class, %parms) = @_; =pod @@ -636,8 +638,6 @@ Returns: =cut - my %parms = @_; - my $self = {}; $self->{host} = $parms{host} ? $parms{host} : 'localhost';