James P Donnelly <[EMAIL PROTECTED]> asked:
> I am only trying to login into a server, travese to the 
> correct directory, dump a file and quit.  I have hacked 
> together something that gets me to the server and
> then it seems to hang at the login..   Has anyone written 
> something like 
> this w/o use of the module?  Any insight would be very helpful
> 
> Thanks -- Jim
> 
> 
> $cmd = 'rftp';
> $rftp_commands =
>                 "open
>                  $fHost
>                  $user
>                  $pass
>                  quit
> ";
> 
>   open(CMD,"|$cmd");
>   print CMD $rftp_commands;
>   close(CMD);

The way it looks you're trying to ram a whole set of commands
down the FTP server's throat at once. No wonder it's choking.

What you should do is use IPC::Open2 so that you're able to
read the output from the FTP program. Then you can script your
way through the process, sending commands only when the client
is prompting for them.

See the perlipc manpage for more info on IPC::Open2.


HTH,
Thomas

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to