nithins has asked for the wisdom of the Perl Monks concerning the following question:

Hi monks

I wanted an sftp connection to one of the servers, hence used Net::SFTP module.The code i have written is below.

my $ftp = Net::SFTP->new($host,$user,$pass) or die "$!"; print "logged in to server for ftp\n";

but while executing i am getting this error :The getpwuid function is unimplemented at C:/strawberry/perl/site/lib/Net/SSH/Perl/SSH2.pm line 39.When i checked in SSH.pm i did find that there was no function implemented with getpwuid name.Can some one help me on this

it set's environment variable ,because of this error it's failing

Replies are listed 'Best First'.
Re: SSH2.pm doesn't have "getpwuid" function
by salva (Canon) on Nov 20, 2013 at 08:31 UTC
Re: SSH2.pm doesn't have "getpwuid" function
by kcott (Archbishop) on Nov 20, 2013 at 08:05 UTC

    G'day nithins,

    You haven't shown any code using getpwuid(). Are you suggesting that the error is generated from one of two lines of code you have posted?

    Perl has a getpwuid function. Perhaps that's what you want? Update: Apparently not! See ++Corion's reponse below.

    Please read "How do I post a question effectively?": a better question will get you better answers.

    -- Ken

      On Windows, Perl does not implement getpwuid(). Most likely, that is the cause of the error. Maybe setting $ENV{HOME} or something like that can help the problem.

        "On Windows, Perl does not implement getpwuid()."

        ++ Thanks - I've updated my response.

        -- Ken