bayruds has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
I am running a perl script as follows:
I am running a perl script as follows:
The -M file test operator above always turns True and exits, even though the logfile is newly generated. I beleive that this could be due to the mtime not being refreshed and hence the error. I get this error whether a previous logfile exists or if the logfile is newly created. Any suggestions as to how this problem could be rectified is welcome. Thanks, Bayruds##BEGIN CODE &setup_command(); #setup command of 3rd party script to run &run_command(); #Run 3rd party script. script generates #file.log my $logfile = "file.log"; if (-M "$logfile" > 0) { print "The logfile generated by 3rd party script is not new\n"; exit(1); } ##END CODE
20040728 Edit by ysth: adjust code tags to only span code
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: -M file test operator
by graff (Chancellor) on Jul 29, 2004 at 02:52 UTC | |
Re: -M file test operator
by beable (Friar) on Jul 29, 2004 at 00:40 UTC | |
by bayruds (Acolyte) on Jul 29, 2004 at 01:42 UTC | |
by beable (Friar) on Jul 29, 2004 at 06:04 UTC | |
Re: -M file test operator
by ysth (Canon) on Jul 29, 2004 at 02:33 UTC |
Back to
Seekers of Perl Wisdom