http://www.perlmonks.org?node_id=435362


in reply to Perl oddities

The -M, -A, and -C file test operators return the file modification, access, and creation times in days since the start of the program. Why? Why why why? Does anyone actually use the values for anything other than to compare them to each other?

The relativity of the dates produced by -M, -C and -A are useful for things like "delete all *.tmp files more than 5 days old" etc.

For example, this lists all the .pl file in the current directory that have been modified in the last 24 hours.

perl -le "-M() < 1 and print for map glob, @ARGV" *.pl 435230.pl junk.pl junk2.pl junk3.pl

My least favorite oddity is the need to use /g option on a regex in order for pos to be set.


Examine what is said, not who speaks.
Silence betokens consent.
Love the truth but pardon error.