I have a script that runs on Linux, but does not run on Windows Perl. Its job is to ssh into a system, do a command, and return the results (In this example an 'ls' to a linux box). It uses Net::SSH::Perl for connection.

When I run this under Red-Hat Linux with Perl v 5.8.0, it runs as expected, returning the listing of the directory. However, under Windows (ActiveState Perl v5.8.8b817) an error is returned. The error is "The getwuid function is unimplemented at c:/Perl/site/lib/Net/SSH/Perl.pm line 110. Net::SSH::Perl was not in the default libraries, so I ran CPAN and installed it from there.

When this error arose, I removed the directories from the site/lib directory, and ran PPM (after installing the http://theoryx5.uwinnipeg.ca/ppms/ repository). I have the same error.

Has anyone else had problems using this module on Windows, and know what to do to fix it? I did a search using "Net::SSH::Perl Windows" and only saw a 'permission denied' entry.

Here is my example

use strict; use warnings; use Net::SSH::Perl; my $server = "mycomp.mywork.office"; my $ssh = Net::SSH::Perl->new($server, options => ["BatchMode yes"]) or die "Failed trying to create primary SSH connection\n"; $ssh->config->set('interactive', 1) unless defined $ssh->config->get('interactive'); $ssh->login("myname", "mypass") or die "Login failed (ssh)\n"; my $cmd = "ls -ltr"; my @response = $ssh->cmd("$cmd"); print "RESPONSE = @response\n"; output:: C:\perlfiles>perl sshtest.pl The getpwuid function is unimplemented at C:/Perl/site/lib/Net/SSH/Per +l.pm line 110.

Thanks!


In reply to un-inplemented function in Net::SSH::Perl for Activestate Perl? by wulvrine

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.