From: ivan Date: Wed, 19 Sep 2001 18:13:21 +0000 (+0000) Subject: debugging X-Git-Tag: NET_SSH_0_03~3 X-Git-Url: http://git.freeside.biz/gitweb/?a=commitdiff_plain;h=cbc06e7ddd0206b1406c7fc06bd0dcec52b4a06f;p=Net-SSH.git debugging --- diff --git a/SSH.pm b/SSH.pm index b56a17f..2c50547 100644 --- a/SSH.pm +++ b/SSH.pm @@ -1,7 +1,7 @@ package Net::SSH; use strict; -use vars qw($VERSION @ISA @EXPORT_OK $ssh); +use vars qw($VERSION @ISA @EXPORT_OK $ssh $DEBUG); use Exporter; use IPC::Open2; use IPC::Open3; @@ -10,6 +10,8 @@ use IPC::Open3; @EXPORT_OK = qw( ssh issh sshopen2 sshopen3 ); $VERSION = '0.02'; +$DEBUG = 0; + $ssh = "ssh"; =head1 NAME @@ -45,6 +47,8 @@ Calls ssh in batch mode. sub ssh { my($host, @command) = @_; my @cmd = ($ssh, '-o', 'BatchMode yes', $host, @command); + warn "[Net::SSH::ssh] executing ". join(' ', @cmd). "\n" + if $DEBUG; system(@cmd); }