#use 5.010; use strict; my $modified_within = 60 * 2; # 2 minutes my $size_limit = 1024 * 1024 * 2; # 2 MB my $OPCMSG = "C:\Program Files\HP\HP BTO Software\bin\win64\OpC\opcmsg.exe"; my $file = "H:\\Program Data\\HP\\HP BTO Software\\shared\\tmp\\queues\\MsgQueue"; if ([stat $file]->[9] > time - $modified_within) { if (-s $file > $size_limit) { # print "File is recent, and over size limit"; } else { print "File is recent, but not over size limit"; $OPCMSG a=OM9 o=failover s=normal mag_t="Hello!! I am fine, hope you are doing well"; } } else { print "File is not recent"; }