X-Git-Url: https://defaria.com/gitweb/?a=blobdiff_plain;f=lib%2FRexec.pm;h=2eecab803b2bb682d2775b27cfa25c0b31629713;hb=3c28a301742e8f8cdd35825fd6ebe4f842a510c7;hp=8d6a9a347ed3af222d87aa4d32d055560cc0e041;hpb=43bcea3777de207abb255b249028892826dfa4f2;p=clearscm.git diff --git a/lib/Rexec.pm b/lib/Rexec.pm index 8d6a9a3..2eecab8 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 { @@ -237,7 +239,7 @@ sub ssh { if ($logged_in) { # It's always hard to find the prompt. So let's make a distintive one - $self->{prompt} = '@@@'; + $self->{prompt} = "\n@@@"; $self->{handle} = $remote; # OK this is real tricky. If we call execute with a command of PS1=@@@ @@ -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';