Please help with FTP module

Mark Steele msteele at toppanelectronics.com
Tue Apr 30 19:15:10 CDT 2002


~sdpm~
Hi All,

Last Perl Mongers meeting I learned from you guys how to get 
the Net::FTP module from CPAN.

I wrote this script, but it "hangs" after 10-30 lines of fast 
output and there is a lot of files in these directories.

When I put in a "sleep 1" command I get a lot more output but
then even then it sometimes hangs. Only when I sleep 2 do I get
the complete dir listing of all the dirs on our FTP site.

So my question to you all is, is there something going on that 
I don't know about? How come I need this sleep command?

Thanks all and have a good time tonight!

------------------------------------------------------------
#!/opt/perl5/bin/perl -w
use Net::FTP;

$ftp = Net::FTP->new("ftp");

# $| = 1; # Stops output even sooner if set...

$ftp->login("cam","simple");
$ftp->cwd("/");
@ls_out = $ftp->ls;

foreach $dir (@ls_out) {
   @dir_output = $ftp->dir("$dir");
   foreach $file (@dir_output) {
     ($date,$time,$size,$name) = split (/\s+/,$file);
     printf ("%-8s %8s %9s %10s %35s\n",$dir,$date,$time,$size,$name);
     sleep 1; # ?????????
   }
}
------------------------------------------------------------



Mark Steele
CAM Automation Engineer
Toppan Electronics, Inc.
858.695.2222
msteele at toppanelectronics.com


~sdpm~

The posting address is: san-diego-pm-list at hfb.pm.org

List requests should be sent to: majordomo at hfb.pm.org

If you ever want to remove yourself from this mailing list,
you can send mail to <majordomo at happyfunball.pm.org> with the following
command in the body of your email message:

    unsubscribe san-diego-pm-list

If you ever need to get in contact with the owner of the list,
(if you have trouble unsubscribing, or have questions about the
list itself) send email to <owner-san-diego-pm-list at happyfunball.pm.org> .
This is the general rule for most mailing lists when you need
to contact a human.




More information about the San-Diego-pm mailing list