Salutations monks

I followed the Monk's guide to FTP::Net and I still cannot get my script to connect to the server. Here's my code

#!/usr/bin/perl use strict; use warnings; use Net::FTP; my $host = "blah.blahblah.nl"; my $user = "ftpuser"; my $password = "qwerty"; my $f = Net::FTP->new($host, Port => 22, Debug=> 1) or die "Cannot ope +n $host\n"; $f->login($user,$password) or die "cannot log $user in\n"; my $dir = "/home/files/cool_beans"; $f->cwd($dir) or die "Can't cwd to $dir\n"; my @files = $f->ls; print @files, "\n";

Here's the output on the terminal

bucephalus:Desktop barney$ perl ftp_test.pl Net::FTP>>> Net::FTP(2.77) Net::FTP>>> Exporter(5.66) Net::FTP>>> Net::Cmd(2.29) Net::FTP>>> IO::Socket::INET(1.33) Net::FTP>>> IO::Socket(1.34) Net::FTP>>> IO::Handle(1.33) Net::FTP=GLOB(0x7ff09b0b55d8)<<< SSH-2.0-OpenSSH_6.0p1 Debian-4+deb7u2 Cannot open blah.blahblah.nl

Am I doing something wrong? Or is it the server? I can login using FileZilla with the same credentials. I am using a Windows device and the server appears to be Unix; could this be an issue with logging in? I tried running the same script on my Mac device and on a Unix cluster and same failure.

My goal is to parse through a lot of files on the server and print the output locally on my device. Is there another way to accomplish this task?

tusen takk monks

In reply to Net::FTP Cannot login to server by pimperator

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.