r28425 - in /trunk/libnet-ssh2-perl/debian: example.pl examples

ryan52-guest at users.alioth.debian.org ryan52-guest at users.alioth.debian.org
Sat Dec 20 00:56:53 UTC 2008


Author: ryan52-guest
Date: Sat Dec 20 00:56:50 2008
New Revision: 28425

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=28425
Log:
include a different example instead; less clutter

Added:
    trunk/libnet-ssh2-perl/debian/example.pl
Modified:
    trunk/libnet-ssh2-perl/debian/examples

Added: trunk/libnet-ssh2-perl/debian/example.pl
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-ssh2-perl/debian/example.pl?rev=28425&op=file
==============================================================================
--- trunk/libnet-ssh2-perl/debian/example.pl (added)
+++ trunk/libnet-ssh2-perl/debian/example.pl Sat Dec 20 00:56:50 2008
@@ -1,0 +1,18 @@
+use Net::SSH2;
+
+my $ssh2 = Net::SSH2->new();
+
+# hostname of the server you are connecting to
+$ssh2->connect('asdf') or die;
+
+# username and password
+$ssh2->auth_password('guest', 'guest') or die;
+
+# run a program
+my $chan = $ssh2->channel();
+$chan->exec('touch test');
+
+# print the contents of a file
+my $sftp = $ssh2->sftp();
+my $fh = $sftp->open('/etc/passwd') or die;
+print $_ while <$fh>;

Modified: trunk/libnet-ssh2-perl/debian/examples
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-ssh2-perl/debian/examples?rev=28425&op=diff
==============================================================================
--- trunk/libnet-ssh2-perl/debian/examples (original)
+++ trunk/libnet-ssh2-perl/debian/examples Sat Dec 20 00:56:50 2008
@@ -1,1 +1,2 @@
-example/*
+debian/example.pl
+




More information about the Pkg-perl-cvs-commits mailing list