Hi,
I am running a perl script as follows:
##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
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
20040728 Edit by ysth: adjust code tags to only span code
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|