in reply to Net::FTP only working occasionally.

You might want to include the last message in your error message (Net::FTP inherits from Net::Cmd, so the method is documented there), e.g.:
$ftp->put($local, $remote) or die "Failed to put file $remote: ".$ftp->message."\n";
Or turn on debugging (see both Net::FTP and Net::Cmd) and see what's going on.