#!/usr/bin/perl -w
######################################################################
# shellfind.pl
######################################################################
# Perl Power! - Michael Schilli 1998
######################################################################

open(FIND, "find . -name '*.pl' -print |");

while(<FIND>) {
    chop;
                      # analyze only files > 1000 bytes
    next if (stat($_))[7] <= 1000;
    next unless -f _; # economical stat()

                      # open and analyze file
    open(FILE, "<$_") || warn "Cannot open $_";
    print "$_\n" if grep(/pattern/, <FILE>);
    close(FILE);
}

close(FIND);

