in reply to Re: Checking file Mod date
in thread Checking file Mod date

Does anyone have an example on how to use this function...
Like what is the output? How will it display the last mod date??

Replies are listed 'Best First'.
Re: Re: Re: Checking file Mod date
by Hofmator (Curate) on Jul 19, 2001 at 17:45 UTC

    The -M filetest operator gives the number of days since modification since startup of the script, so:

    my $age = -M $file; if ($age < 7) { # do something } # or directly if (-M $file < 7) { # do something }

    -- Hofmator