home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!elroy.jpl.nasa.gov!swrinde!mips!darwin.sura.net!jvnc.net!synapse.bms.com!synapse!anderson
- From: anderson@zymurgy.bms.com (Jay Anderson)
- Newsgroups: comp.lang.perl
- Subject: help with ftp.pl/chat2.pl
- Message-ID: <ANDERSON.92Aug12175926@zymurgy.bms.com>
- Date: 12 Aug 92 22:59:26 GMT
- Sender: news@synapse.bms.com
- Distribution: comp.lang.perl
- Organization: BMS Pharmaceutical Research Institute
- Lines: 74
-
- I'm trying to use ftp.pl without too much success. I keep getting bombed out in
- the eval of the following loop (really from chat2.pl). Any ideas of what's going
- awry?
-
-
- &ftp'open( some_real_site.on.the.net, 21, 1, 1 )
- sub expectloop000001 {
- LOOP: {
- if (0) { ; }
- elsif ($S =~ /^(221 .*)\015\n/) {
- $S = $';
- package ftp;
- &ftp'expectgot( $1, 0 ); 1;
- }
- elsif ($S =~ /^(500 .*)\015\n/) {
- $S = $';
- package ftp;
- &ftp'expectgot( $1, 0 ); 0;
- }
- elsif ($S =~ /^(.*)\015\n/) {
- $S = $';
- package ftp;
- &ftp'expectgot( $1, 0 ); 100;
- }
- elsif ($timeout) {
- package ftp;
- &ftp'expectgot( "timed out", 1 ); 0;
- }
- elsif ($eof) {
- package ftp;
- &ftp'expectgot( "remote server gone away", 1 ); 0;
- }
- else {
- $rmask = "";
- vec($rmask,fileno(S),1) = 1;
- ($nfound, $rmask) =
- select($rmask, undef, undef, $endtime - time);
- if ($nfound) {
- $nread = sysread(S, $thisbuf, 1024);
- if ($nread > 0) {
- $S .= $thisbuf;
- } else {
- $eof++, redo LOOP; # any error is also eof
- }
- } else {
- $timeout++, redo LOOP; # timeout
- }
- redo LOOP;
- }
- }
- }
- :
- syntax error in file (eval) at line 2, next 2 tokens "LOOP:"
- syntax error in file (eval) at line 4, next 2 tokens "}
- elsif"
- syntax error in file (eval) at line 8, next 2 tokens "}"
- syntax error in file (eval) at line 13, next 2 tokens "}"
- syntax error in file (eval) at line 18, next 2 tokens "}"
- syntax error in file (eval) at line 22, next 2 tokens "}"
- syntax error in file (eval) at line 26, next 2 tokens "}"
- syntax error in file (eval) at line 43, next 2 tokens "}"
-
-
-
-
-
- --
- +---------------------------------------------------------------------+
- | Jay Anderson - N3JMC Internet: anderson@optical.bms.com |
- | Bristol-Myers Squibb Company Work: (609)-252-6039 |
- | Princeton, NJ 08543 Home: (215)-836-1225 |
- | I have a dinosaur for a representative, he has a small brain and |
- | refuses to learn. |
- +=====================================================================+
-