in reply to Net::FTP only working occasionally.

First, I wouldn't kill postfix's processes if I were you.

Second, this code will never run as is. Too many compilation errors. Are you sure that this is the code you are running?

Add my's to each of the variable declarations, then remove the final ) from the $address declaration line. Speaking of which, what is the point of using $address here at all, when you can use $site?

$ftp->cwd('./main.html'); is all wrong unless you have a directory called main.html.

$ftp->type('binary'); can be rewritten as $ftp->binary(); since they are synonomous.

Update: You might want to check for the existance of '/home/wolfger/Shared/Documents/wolfger/howllog.html' before trying to upload it.

sometime later: /me shrugs

Replies are listed 'Best First'.
Re: Re: Net::FTP only working occasionally.
by wolfger (Deacon) on Mar 31, 2003 at 18:29 UTC
    Err... Uhm. Okay, I must confess. In the script I'm actually running, I deleted "use strict;"
    (I posted the script as I orignally wrote it. The actual script is at home)

    There is no point to $address. It was used simply for the sake of using it...

    The directory is main_html. Underscore, not dot.

    and yes, the source file exists. As I said, sometimes the script works. Sometimes it doesn't.

      If it sometimes works, and sometimes doesn't, you should look into the process that provides the FTP service, not your code, IMO.

      I don't have any experience with uploading files, but I'm constantly running into the same kind of error when retrieving files from an FTP server (MS IIS in my case).
      At first, I thought it was my code, when my colleague noticed the FTP server shut down his connection once in a while too. He was using IE to manually look up files.

      Our system people were not able to come up with a solution, but we did notice that this strange behaviour occurred omre frequently when network traffic was at a peak.

      So maybe you should toy around with a browser for a while and see what happens?

      Cheers,
      MichaelD