lanier has asked for the wisdom of the Perl Monks concerning the following question:
#! /u/ss/bin/perl -w use Net::FTP; $ntsrv="ntsrv"; @number=qw(143 148 171 177 180 184 186 191 207 225 226 229 471 530 593 + 661 663 669 672 673 674 675 676 677 673 674 675 676 677 678 679 679A 681 685 687 691 700 702 703 7 +06 707 709 711 715 717 731 732 734 737 738 741 743 749 751 755 761 762 768 769 773 777 779 780 78 +1 788 821 824 828 875 886); $count=0; $in=" "; while ($count <= $#number) { $in=$ntsrv.$number[$count]; print "$in \n"; $ftp=Net::FTP->new("$in") or warn "Can't open $in: $!" ; $ftp->login("sfouser",'password') or warn "Can't login: $!"; if (!defined $ftp->ls){ print "Directory is empty \n"; } else { print $ftp->ls; print "\n"; } $ftp->put("test.txt") or warn "Can't transfer file: $!"; print $ftp->ls; print "\n"; $ftp->delete("test.txt") or warn "Can't delete file: $!"; if (!defined $ftp->ls){ print "Directory is empty \n"; } else { print $ftp->ls; print "\n"; } $ftp->quit() or warn "Can't quit from $in: $!"; print "finished\n \n"; $count++; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Problems with Loop
by Helter (Chaplain) on Sep 06, 2002 at 21:13 UTC | |
|
Re: Problems with Loop
by Marza (Vicar) on Sep 06, 2002 at 20:37 UTC | |
|
Re: Problems with Loop
by blaze (Friar) on Sep 06, 2002 at 19:57 UTC | |
|
Re: Problems with Loop
by traveler (Parson) on Sep 06, 2002 at 20:57 UTC | |
|
Re: Problems with Loop
by lanier (Initiate) on Sep 09, 2002 at 14:31 UTC | |
by Marza (Vicar) on Sep 09, 2002 at 20:11 UTC |