Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Hi Bayruds,

First, a quick note about formatting your posts: put "<code>" and "</code>" at the beginning and end of perl code -- not including paragraphs of text (use plain old html tags like <P>, <UL>, etc to format your text). It's easy to get to Writeup Formatting Tips -- take a look at that.

Second, how about you try one more diagnostic: create a junk file (or locate such a file that already exists), and give the path/name of that file as a command line arg to this little script:

#!/usr/bin/perl print "-M of $ARGV[0] is ".(-M $ARGV[0]).$/; # should be positive system("touch $ARGV[0]"); # reset file's mod time to now. sleep 1 print "-M of $ARGV[0] is now ".(-M $ARGV[0]).$/; # should be (very sma +ll) negative sleep 4; print "-M of $ARGV[0] is now ".(-M $ARGV[0]).$/; # should be equal to +previous
If the outputs disagree with the comments, you might have a deep problem -- you may need to report which OS you're using, and which perl version. (Maybe even what sort of hardware you have.)

You seem to be doing the right sort of test (-M>0), so it could still be one of those cases where you really believe that you're checking the right file (the same one that the 3rd party thing created), and that the file is new, etc, when in fact...

update: fixed link


In reply to Re: -M file test operator by graff
in thread -M file test operator by bayruds

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • 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.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (3)
As of 2024-04-20 03:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found