help with ftp.pl/chat2.pl 
Author Message
 help with ftp.pl/chat2.pl

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;
                }
        }

Quote:
}

:
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 "}"

--
+---------------------------------------------------------------------+

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



Mon, 30 Jan 1995 06:59:26 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Help: problem with ftp.pl and chat2.pl

2. Chat2.pl, ftp.pl, etc

3. socket.ph, ftp.pl and chat2.pl error found for Solaris and Irix

4. IBM AIX (SP/2) - CHAT2.PL <- FTP.PL <- perl5.0 Code

5. chat2.pl, hget.pl and socket.ph problems

6. chat.pl & chat2.pl

7. More fun with chat2.pl and select.pl

8. hget.pl, chat2.pl and socket.ph problems

9. ANNOUNCE:chat3-a1.pl is chat2.pl + logging facilities

10. ANNOUNCE: Comm.pl, a new expect/chat2.pl pkg, Beta1

11. Best ftp wrapper for chat2.pl?

12. ftp.pl, lchat.pl, socket.ph

 

 
Powered by phpBB® Forum Software