I have written a script to find files

I now want to be able to pass it a days parameter and only show files modified in the last x days

How do I do this

Any help acheiving this would be much appreciated

My script so far is below

use strict; use lib 'jumi'; use WebLib; use File::Find; use File::Basename; my ( $folder, $tofind, $tofile, $exclude, $cs ) = @ARGV; my @tofind = split '&&',$tofind; #strip whitespace @tofind = grep(s/\s*$//g, @tofind); @tofind = grep(s/^\s*//g, @tofind); foreach(@tofind) {print "|$_|<br>";} print "<p>Excluded:<br>$exclude</p>"; find(\&wanted, $folder); print qq {<script type="text/javascript">colourRows();</script>}; sub wanted { my $file = $File::Find::name; return unless -T $file; return unless $file =~ /$tofile/; return if $file =~ /$exclude/ && $exclude; if ($tofind) { open F, $file or print "couldn't open $file\n" && return; my $file_contents = do { local $/; <F> }; close F; my $print = 'Y'; foreach (@tofind) { if ($cs == 1){ if ($file_contents !~ /$_/m) {$print = 'N'}; } else { if ($file_contents !~ /$_/mi) {$print = 'N'}; } } if ($print eq 'Y'){ print qq {<tr><td><a href="index.php? option=com_content&view=article&id=21&file=$file" target="_blank"> $file</a></td></tr>}; } #end if } else { print qq {<tr><td><a href="index.php? option=com_content&view=article&id=21&file=$file" target="_blank"> $file</a></td></tr>}; }

In reply to use file::find to find files modified in last 5 days by mikesolomon

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.