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

I am not sure if I have Net::SFTP module installed on my system:
I think it is on my system, because when I code my perl script something like this:

use Net::SFTP;
use Net::SFTP::Attributes $lib_dir;
The script does not complain not finding the module.

But when I used something I found from web:
1. perl -MFile::Find=find -MFile::Spec::Functions -lwe 'find { wanted => sub { print canonpath $_ if /\.pm\z/ }, no_chdir => 1 }, @INC'
2. perl -MNet::SFTP -e l
Either method finds the pm.

If I do have the module, where is it?

  • Comment on Do I have Net::SFTP module installed on my Sun Solaris?

Replies are listed 'Best First'.
Re: Do I have Net::SFTP module installed on my Sun Solaris?
by salva (Canon) on Aug 20, 2009 at 15:57 UTC
    try...
    use Net::SFTP; print "Module path: $INC{'Net/SFTP.pm'}\n"
      This works great! Thanks you!
Re: Do I have Net::SFTP module installed on my Sun Solaris?
by moritz (Cardinal) on Aug 20, 2009 at 15:45 UTC
    The script does not complain not finding the module.

    (emphasis by me) so everything is fine, no?

    If it's not found anyway, check that the script is run by the same perl executable as your tests do (there could be multiple), and with the same environment variables.

    Perl 6 projects - links to (nearly) everything that is Perl 6.
Re: Do I have Net::SFTP module installed on my Sun Solaris?
by Illuminatus (Curate) on Aug 20, 2009 at 15:56 UTC
    1. Your post makes no sense, unless you meant to say 'neither' instead of 'either'
    2. Are you using a '#! <path-to-perl>' line at the top of your script? If so, does that resolve to the same perl as those used in the latter part of your post?
    3. If the script does not complain, does it work?
    4. If you have any doubts, can't you just install it? Even if you don't have access to the 'standard' include areas, you can create your own, and add it to @INC inside your script...

    fnord

Re: Do I have Net::SFTP module installed on my Sun Solaris?
by alexm (Chaplain) on Aug 20, 2009 at 19:37 UTC

    Try this from the command line:

    perldoc -l Net::FTP
Re: Do I have Net::SFTP module installed on my Sun Solaris?
by trwww (Priest) on Aug 21, 2009 at 05:18 UTC

    If I do have the module, where is it?

    perl -MNet::SFTP -le "print $INC{q|Net/SFTP.pm|}"

    will probably tell you