#! /usr/local/bin/perl -w eval 'exec /usr/local/bin/perl -S $0 ${1+"$@"}' if 0; #$running_under_some_shell use strict; use File::Find (); # Traverse desired filesystems File::Find::find({wanted => \&wanted}, '.'); exit; sub wanted { my ($dev,$ino,$mode,$nlink,$uid,$gid); return unless /^.*\.shtml\z/s && (($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) && (int(-M _) < 30); # now do whatever you want with the file named # by $File::Find::name # this is probably not what you want to do: print("$File::Find::name\n"); } #### $ find2perl . -name "*.shtml" -mtime -30