Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
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=""; $username="anonymous"; $password="me\"; $path="/goldenPath/05apr2002/chromosomes/"; $filename=""; $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 get( 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 (
"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

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2022-05-18 03:31 GMT
Find Nodes?
    Voting Booth?
    Do you prefer to work remotely?

    Results (68 votes). Check out past polls.