use strict; use warnings; use File::Find; use File::Slurp; my @starters = @ARGV ? @ARGV : qw(.); my @files; @ARGV = (); find sub { push @files, $File::Find::name if /\.(pl|pm)$/; # or whatever condition here }, @starters; print "Perl files that don't use the stricutres\n"; foreach my $file (@files) { my $text = read_file( $file ) ; print "$file\n" unless ( $text =~ /use warnings;/ && $text =~ /use strict;/ ) ; }