<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">#!/usr/local/bin/perl

##################################################################
$WrittenBy = "Arther Neal Garrett";                               
     $Date = "Oct 19, 2004";                                      
  $Version = "v1.0";                                              
##################################################################

use Net::FTP;

$username = "UserName";
$password = "Password";
@hosts = qw(192.168.0.1 192.168.0.2 192.168.0.3);
@watchlist = qw(MyScript.pl MyPerlTest.pl MyPerl.pl); 

#Initialize
$last = 1;$mtime = 0;$i = 1;

while ($i &gt; 0) {
	foreach $watchfile(@watchlist) {
		chomp($watchfile);
		($dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size, $atime, $mtime, $ctime, $blksize, $blocks)= stat("$watchfile");
		if ($i == 1) {$last = $mtime;}
		if($mtime &gt; $last) {&amp;FTPPUT;$last = $mtime;}
	}
	$i = ($i +1);
	sleep 1;
}

sub FTPPUT {
	foreach $hostname(@hosts) {
		chomp($hostname);
		$ERRX = 0;
		@ftplog = $ftp = Net::FTP-&gt;new("$hostname", Port =&gt; 21, Debug =&gt; 0, Timeout =&gt; 15,) or &amp;ERROR("Can't FTP to $hostname\n");
		$ftp-&gt;login("$username","$password") or &amp;ERROR("$username DENIED access to $hostname.\n");
		$ftp-&gt;binary();
		$ftp-&gt;cwd("/netexpert/netexpert_vsm5.0/Custom/NETEXPORT") or &amp;ERROR("cwd change directory failed\n");
		$ftp-&gt;put("$watchfile") or &amp;ERROR("$watchfile transfer to $hostname failed\n");
		$ftp-&gt;quit;
		$ftptime = localtime();
		unless($ERRX) {
			print "$watchfile ftp\'d to $hostname\t $ftptime\n";
		}
	}
}

sub ERROR {	
	unless($ERRX) {
		warn "ERROR: @_";
		$ERRX = 1;
	}
}
	</pre></body></html>