esskar,

use Net::FTP; my $ftp = Net::FTP->new( "192.168.10.240", Debug => 1) or die "Cannot connect to " . "192.168.10.240" . ": $@"; $ftp->login("metrica", "metrica") or die "Cannot login ", $ftp->message; $ftp->cwd("/apps/inst1/metrica") or die "Cannot change working directory ", $ftp->message; $ftp->pasv; my @dir = $ftp->ls; # <-- LINE 50 print "Files :" , join('-',@dir), "\n";
I executed the above code and it worked fine for me.
Trace output
C:\Perl>perl l.pl Net::FTP>>> Net::FTP(2.75) Net::FTP>>> Exporter(5.58) Net::FTP>>> Net::Cmd(2.26) Net::FTP>>> IO::Socket::INET(1.29) Net::FTP>>> IO::Socket(1.29) Net::FTP>>> IO::Handle(1.25) Net::FTP=GLOB(0x18331d8)<<< 220 osmosis FTP server ready. Net::FTP=GLOB(0x18331d8)>>> user metrica Net::FTP=GLOB(0x18331d8)<<< 331 Password required for metrica. Net::FTP=GLOB(0x18331d8)>>> PASS .... Net::FTP=GLOB(0x18331d8)<<< 230 User metrica logged in. Net::FTP=GLOB(0x18331d8)>>> CWD /apps/inst1/metrica Net::FTP=GLOB(0x18331d8)<<< 250 CWD command successful. Net::FTP=GLOB(0x18331d8)>>> PASV Net::FTP=GLOB(0x18331d8)<<< 227 Entering Passive Mode (192,168,10,240, +227,44) Net::FTP=GLOB(0x18331d8)>>> PASV Net::FTP=GLOB(0x18331d8)<<< 227 Entering Passive Mode (192,168,10,240, +227,44) Net::FTP=GLOB(0x18331d8)>>> NLST Net::FTP=GLOB(0x18331d8)<<< 150 Opening ASCII mode data connection for + file list . Net::FTP=GLOB(0x18331d8)<<< 226 Transfer complete. Files :AlarmManagement-CS-DBElements-DBLoader-DBServices-DataSources-E +xtenders-E xternal-GroupingService-Installer-MLEditor-MetaLayer-PMhelp-ReportDesi +gner-Repor ting-SPRegistry-Security-StartStop-SystemManagement-SystemTPhelp-Techn +ologyPacks -Uiweb-antony.txt-cell-tch-REPRT_0610-export-config-file.xml-cell-tch- +argan-expo rt-config-file.xml-cell-tch-rflosses-export-config-file.xml-cell_voice +_traffic_r aw_spr-param.xml-etc-ext-install_setup.ksh-logs-maeve-metrica_healthch +eck.html-n ohup.out-one.pl-setup.ksh-setup.tpl-setup_appserver.ksh-setup_informix +.ksh-setup _java.ksh-setup_openfusion.ksh-update3FFPromo.pl-utils

"Keep pouring your ideas"

In reply to Re: NET::FTP: ls command fails by jesuashok
in thread NET::FTP: ls command fails by esskar

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.