#!/usr/bin/perl use strict; use warnings; my $logfile = "file.log"; my $internal = 0; if ($internal) { # create a logfile open LOGFILE, ">$logfile" or die "can't open $logfile: $!"; print LOGFILE "This is a test\n"; close LOGFILE or die "can't close $logfile: $!"; } else { # create logfile externally system("./write-log"); } # sleep? sleep 3; print "minus M returns: ", (-M $logfile), "\n"; # test modification time if (-M $logfile > 0) { print "The logfile generated by 3rd party script is not new\n"; exit(1); } else { print "It's a new logfile! Hoooray!\n"; } __END__