#!D:/perl/bin use strict; use File::stat qw(:FIELDS); my ($goodDir, $path, $host1, $host2, $checkDir, $currentFile, $currentFile1, $st_size, $st_mtime, $stat, $size, $modtime); my %hashDir1 =(); print "What host would you like to use as template: ?\n"; chomp($host1 = ); print "Whats the path you want to use? \n"; chomp($path = ); $goodDir = "//" . $host1 . $path; print $goodDir . "\n"; opendir(GD, $goodDir) or die "Can't open $goodDir : $!"; print "what host would you like to examine? \n"; chomp($host2 = ); $checkDir = "//" . $host2 . $path; opendir(CD, $checkDir) or die "Can't open $checkDir : $!"; while($currentFile = readdir(GD)) { $currentFile1 = "//" . $host1 . $path . $currentFile . "\n"; print $currentFile1 . "\n"; stat($currentFile1) or warn "No File :$!"); #$stat = stat($currentFile1) or warn "can't stat the file :$!\n"; if ( $st_size & $st_mtime) { $size = $st_size; $modtime = $st_mtime; }else{ print "couldn't stat $currentFile1 : $!"; next; } }