in reply to Re: How do you write a perl script to calculate the age of a file
in thread How do you write a perl script to calculate the age of a file

Ah, when will the golf urge pass? You could do: unlink $filename if -M $filename > 2; saving yourself two parentheses and two squiggly braces. ;-)

It even reads exactly as the questioner proposed: "delete the file if it is more than two days old".

  • Comment on Re: Re: How do you write a perl script to calculate the age of a file
  • Download Code