Hello Everyone:
I am uisng NET:

FTP module to access a remote server. Everyone 5 minutes, there is cron job calling my script to
upload file onto the remote server.
I would like to knnow how can I close the SFTP connection without exiting my Perl script. I appreciate your advises and help!
Would it be OK, If I don't close SFTP connection, will it affect the file transfer?
My code snippet
#!/usr/bin/perl
use Net:

FTP;
sub ftp_send() {
my($file) = @_;
$sftp = Net:

FTP->new('xxx', user=>'zzz', password=>'yyy', debug=>1);
$sftp->put("$homedir", "$remote");
#close the SFTP connection here exit SFTP environment
}
if ($sth->rows > 0)
{
while($href = $sth->fetchrow_hashref()) {
$optCount++;
&build_file($href);
}
$filename = 'test.txt';
open(out, ">>/home/$filename") || die("Couldn't open data file $!\n");
print out $table;
close(out);
&ftp_send($filename);
}