Can't locate Net/ in

Posted on 2004-11-04
Last Modified: 2008-01-09
New user

I am getting the following error message:
Can't locate Net/ in @INC (@INC contains: ../lib.

BEGIN failed—compilation aborted at …. line 3

line 3 has "use Net::SFTP;

    use Net::SFTP;
    $host = ' xxx';
    $userb = ' yyy ';
    $pass = ' zzz';
    my $sftp = Net::SFTP->new($host);
    $sftp->login($user, $pass);

Can anyone say what could be wrong? Need immediate answer
Question by:dbruk
    LVL 18

    Accepted Solution

    you need to install Net::SFTP.

        perl -MCPAN -e 'install Net::SFTP'
    on a shell (as root), and you should be good to go.
    LVL 48

    Expert Comment

    or if you did install Net::SFTP, explain how you installed it.
    LVL 3

    Expert Comment

    Net::SMTP is a part of libnet perl module which can be downloaded from this site:
    You could also download Net::SMTP separately and put it together with your script in case if you don't have admin right on this server.
    LVL 48

    Expert Comment


    SMTP has nothing to do with SFTP
    LVL 3

    Expert Comment

    Tintin, you are right. I was playing with Net::SMTP just few minutes before this answer.
    Anyway, it's just a missing module problem which can be installed using cpan shell or downloaded and installed manually from or any mirror.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    Extract multiple value with delimiters from a string 4 165
    Strange perl issue 6 116
    transpose into pipe delemited 8 61
    Perl Awk Need Help 3 85
    I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
    In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (…
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now