Net-SFTP - SFTP Exit call stops perl script

Posted on Wed Oct 4 01:32:05 2006 by astern
SFTP Exit call stops perl script
I am using perl to transfer file from a remote server to another using sftp. I'm not sure what it means, but we connect to the server using Expect. When the transfer is done (the transfer works fine), there is code to exit sftp. The exit, though, not only exits the sftp connection, but also stops the perl script. How can I exit the sftp connection, but still maintain the perl script? Also, what is the interact used for? Here is some of the code: my $expt = Expect->spawn("sftp ".$destination_ftp_username."\@".$destination_server); $expt->send("$destination_ftp_password\n"); $expt->send("cd $destination\n"); $expt->send("put ".$rootdir.$tempdir.$fileinfo[1]."\n"); $expt->send("exit\n"); $expt->interact;
Direct Responses: 3193 | 4699 | Write a response