Wise Monks,

I have been trying for a good hour now to figure out why this code is not working. I think it may be my ignorance of FTP coupled with my first use of Net::FTP.

The code:

#!/usr/bin/perl -w use strict; use Net::FTP; my ($ftp, $destination, $username, $password, $filename, $path); $destination="genome.ucsc.edu"; $username="anonymous"; $password="me\@there.com"; $path="/goldenPath/05apr2002/chromosomes/"; $filename="chr5.zip"; $ftp = Net::FTP->new($destination, Debug => 0) || die "Couldn't connec +t! $!\n"; $ftp->login($username,$password) || die "Couldn't log in! $!\n"; $ftp->cwd($path) || die "couldn't cwd! $!\n"; $ftp->get($filename) || die "get($filename) failed: " . $ftp->code() . + ": " . $ftp->message(); $ftp->quit;
This dies with the error:
[dswan@ashtaroth GUP]$ perl ftp.pl get(chr5.zip) failed: 500: Illegal PORT command.
I am assuming this has something to do with a failure to use the pasv/port options of Net::FTP - I have tried ftp->pasv() and ftp->port() (leaving blank, and specifying a port). Its not a firewall issue as I can happily use a command line client to make it work - and grab the file.

Yours, in bewilderment,

Bukowski - aka Dan (dcs@black.hole-in-the.net)
"Coffee for the mind, Pizza for the body, Sushi for the soul" -Userfriendly

Title edit by tye


In reply to Net::FTP and 'Illegal PORT command' by Bukowski

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.