Please help with FTP module

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

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...

@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.
msteele at


The posting address is: san-diego-pm-list at

List requests should be sent to: majordomo at

If you ever want to remove yourself from this mailing list,
you can send mail to <majordomo at> 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> .
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