You should try getting an FTP connection working manually and see what requirements you need to fulfil for that. For example, in many network setups (particularly if you're in a NATed network) you need to activate passive mode in your FTP connection. The sentence

As my institute uses proxy

sounds a bit suspicious to me, because there are many types of proxies for the various protocols (HTTP,STMP,FTP) and you don't seem to know which one your institute is using and whether it's being used to proxy FTP connections at all. It may be entirely transparent to you as the user or a SOCKS proxy. So I would recommend using the command line "ftp" utility and trying to get a working connection with that, trying out options until you achieve a result.

Having said that, there is a bug in the way you are trying to set the Firewall option, the line

my $ftp=Net::FTP->new("ftp.cpan.org","XXXX")

should be

my $ftp=Net::FTP->new("ftp.cpan.org",Firewall => "XXXX")

, maybe that solves your problem already.

<private pet rant>Whyohwhy is this option called "Firewall" in Net::FTP when it clearly refers to the proxy? A proxy is not a firewall nor the other way around! The fact that both are often implemented on the same machine does not mean they are equivalent, and confusing users (who are often confused enough of their own accord) further by using wrong terminology in the module is extremely regrettable</rant>


All dogma is stupid.

In reply to Re: Problem with Net::FTP by tirwhan
in thread Problem with Net::FTP by cool

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.