--- /dev/null
+Net::SSH v0.01
+
+Copyright (c) 2000 Ivan Kohler.
+Copyright (c) 2000 Silicon Interactive Software Design.
+Copyright (c) 2000 Freeside Internet Services, LLC
+All rights reserved.
+This program is free software; you can redistribute it and/or modify it under
+the same terms as Perl itself.
+
+This module implements a Perl interface to ssh.
+
+To install:
+ perl Makefile.PL
+ make
+ make test # nothing substantial yet
+ make install
+
+Documentation will then be available via `man Net:SSH' or `perldoc Net::SSH'
+
+Anonymous CVS access is available:
+ $ export CVSROOT=":pserver:anonymous@cleanwhisker.420.am:/home/cvs/cvsroot"
+ $ cvs login
+ (Logging in to anonymous@pouncequick.cleanwhisker.420.am)
+ CVS password: anonymous
+ $ cvs checkout Net-SSH
+as well as <http://www.420.am/cgi-bin/cvsweb/Net-SSH>.
+
+A mailing list for users and developers is available. Send a blank message to
+<ivan-netssh-subscribe@420.am> to subscribe.
+
+Ivan Kohler <ivan-netssh@420.am>
+20 4,16 * * * saytime
+
+$Id: README,v 1.1 2000-10-09 16:28:49 ivan Exp $
+
--- /dev/null
+package Net::SSH;
+
+use strict;
+use vars qw($VERSION @ISA @EXPORT_OK $ssh);
+use Exporter;
+use IPC::Open2;
+use IPC::Open3;
+
+@ISA = qw(Exporter);
+@EXPORT_OK = qw( ssh issh sshopen2 sshopen3 );
+$VERSION = '0.01';
+
+$ssh = "ssh";
+
+=head1 NAME
+
+Net::SSH - Perl extension for secure shell
+
+=head1 SYNOPSIS
+
+ use Net::SSH qw(ssh issh sshopen2 sshopen3);
+
+ ssh('user@hostname', $command);
+
+ issh('user@hostname', $command);
+
+ sshopen2('user@hostname', $reader, $writer, $command);
+
+ sshopen3('user@hostname', $reader, $writer, $error, $command);
+
+=head1 DESCRIPTION
+
+Simple wrappers around ssh commands.
+
+=head1 SUBROUTINES
+
+=over 4
+
+=item ssh [USER@]HOST, COMMAND [, ARGS ... ]
+
+Calls ssh in batch mode.
+
+=cut
+
+sub ssh {
+ my($host, @command) = @_;
+ my @cmd = ($ssh, '-o', 'BatchMode yes', $host, @command);
+ system(@cmd);
+}
+
+=item issh [USER@]HOST, COMMAND [, ARGS ... ]
+
+Prints the ssh command to be executed, waits for the user to confirm, and
+(optionally) executes the command.
+
+=cut
+
+sub issh {
+ my($host, @command) = @_;
+ my @cmd = ($ssh, $host, @command);
+ print join(' ', @cmd), "\n";
+ if ( &_yesno ) {
+ system(@cmd);
+ }
+}
+
+=item sshopen2 [USER@]HOST, READER, WRITER, COMMAND [, ARGS ... ]
+
+Connects the supplied filehandles to the ssh process (in batch mode).
+
+=cut
+
+sub sshopen2 {
+ my($host, $reader, $writer, @command) = @_;
+ open2($reader, $writer, $ssh, '-o', 'Batchmode yes', $host, @command);
+}
+
+=item sshopen3 HOST, WRITER, READER, ERROR, COMMAND [, ARGS ... ]
+
+Connects the supplied filehandles to the ssh process (in batch mode).
+
+=cut
+
+sub sshopen3 {
+ my($host, $writer, $reader, $error, @command) = @_;
+ open3($writer, $reader, $error, $ssh, '-o', 'Batchmode yes', $host, @command);
+}
+
+sub _yesno {
+ print "Proceed [y/N]:";
+ my $x = scalar(<STDIN>);
+ $x =~ /^y/i;
+}
+
+=back
+
+=head1 AUTHOR
+
+Ivan Kohler <ivan-netssh@420.am>
+
+=head1 BUGS
+
+Not OO.
+
+Look at IPC::Session?
+
+=head1 SEE ALSO
+
+ssh(1), L<IPC::Open2>, L<IPC::Open3>
+
+=cut
+
+1;
+
--- /dev/null
+# Before `make install' is performed this script should be runnable with
+# `make test'. After `make install' it should work as `perl test.pl'
+
+######################### We start with some black magic to print on failure.
+
+# Change 1..1 below to 1..last_test_to_print .
+# (It may become useful if the test is moved to ./t subdirectory.)
+
+BEGIN { $| = 1; print "1..1\n"; }
+END {print "not ok 1\n" unless $loaded;}
+use Net::SSH;
+$loaded = 1;
+print "ok 1\n";
+
+######################### End of black magic.
+
+# Insert your test code below (better if it prints "ok 13"
+# (correspondingly "not ok 13") depending on the success of chunk 13
+# of the test code):
+