#!/usr/bin/perl -w use FindBin; chdir("$FindBin::Bin/.."); opendir(DIR, '.'); @dir = readdir(DIR); closedir(DIR); if(my @new = grep {-f and $_ ne "index.html"} @dir) { # send mail... # ... print "New files:\n"; print " * $_\n" foreach @new; }