Rémi T > Net-SSH2-Simple > Net::SSH2::Simple

Download:
Net-SSH2-Simple/Net-SSH2-Simple.zip

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.01   Source  

NAME ^

Net::SSH2::Simple - Simpler interface to Net::SSH2

VERSION ^

Version 0.01

SYNOPSIS ^

Net::SSH2::Simple provide limited but simpler interface to Net::SSH2.

Perhaps a little code snippet.

    use Net::SSH2::Simple;

    my $ssh2 = Net::SSH2::Simple->new();
    ...
    {
        my ($stdout,$stderr, $exitcode) = $ssh2->cmd( "uname -sr" ) or die "cannot execute uname: $self->error";
        if ($exitcode == 0) {
                print $stdout if $stdout;
                print $stderr if $stderr;
        } else {
                print $stderr if $stderr;
                die "uname failed with exit code $exitcode";
        }       
        }
        ...     
        {
        my ($stdout,$stderr, $exitcode) = $ssh2->cmd( "ls -latr", 'timeout' => 5_000, 'bufsize' => 4_096 );
        }

EXPORT ^

sub cmd

head1 CAVEAT

cmd: only one command line can be executed over this channel. No "ls -l;whoami" combo. Use ssh->shell instead

head1 WORKAROUND

cmd: use parenthesis for cmd combo

        ...
        {
                my ($stdout,$stderr,$exit)=$ssh->cmd("(echo \"workaround\" ; nice ps auxw)") or die "Cannot exec combo: $self->error";
        }

SUBROUTINES/METHODS ^

new

cmd

AUTHOR ^

remi, <remi at chez.com>

BUGS ^

Please report any bugs or feature requests to bug-net-ssh2-simple at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Net-SSH2-Simple. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT ^

You can find documentation for this module with the perldoc command.

    perldoc Net::SSH2::Simple

You can also look for information at:

ACKNOWLEDGEMENTS ^

LICENSE AND COPYRIGHT ^

Copyright 2009 remi.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.

syntax highlighting: