#!/usr/bin/perl -wT use strict; use CGI::Carp qw(fatalsToBrowser warningsToBrowser); use CGI ':standard'; use File::Find; print "Content-type: text/html\n\n"; my $dir = '/myroot/public_html/cgi-bin'; my $word = param('word'); $word =~ /(^\w+|\s+$)/; my $valid = $1; unless ($valid) { print 'no word'; exit; } find(\&find_word, $dir); sub find_word { if (($File::Find::name =~ /\.pl/) or ($File::Find::name =~ /\.cgi/)) { open FH, '<', $File::Find::name or die "Can't open $File::Find::name: $!"; while (my $line = ) { chomp; if ($line =~ /$valid/) { print "$File::Find::name == $line\n\n" } } } } #### Software error: Insecure dependency in chdir while running with -T switch at /usr/lib/perl5/5.8.8/File/Find.pm line 844, line 43175.