<?xml version="1.0" encoding="windows-1252"?>
<node id="328464" title="Re: Re: 'Permission Denied' error from File::Find" created="2004-02-11 22:18:13" updated="2005-08-08 09:15:11">
<type id="11">
note</type>
<author id="296824">
witandhumor</author>
<data>
<field name="doctext">
All:&lt;br&gt;With all of the help given to me here(and some one-on-one tutoring) I was able to work out most of my issues! Thank you very much!!!!!!!!!!!&lt;p&gt;
Here is my most recent attempt..getting there&lt;p&gt;
&lt;code&gt;
#!c:\perl\bin\perl.exe -w

use strict;
use File::Find;


#variables
my ($directory,$file,$text);

print "Enter search text: ";
	$text = &lt;STDIN&gt;;
  	chomp $text;

$directory = 'c:\my_directory';
find (\&amp;search,$directory);

sub search {
	my $file = $File::Find::name;
	if (-r $file &amp;&amp; -f $file) {
	open (FILE, "$file") or die "Guess what, it didn't work! $!\n";
	while (my $line = &lt;FILE&gt;) {
	print "$text - $file\n"
	if $line =~ /$text/;
	}	
}
close FILE;
}
&lt;/code&gt;</field>
<field name="root_node">
328125</field>
<field name="parent_node">
328194</field>
</data>
</node>
