Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I am very new to Perl and need your help.

#!c:\perl\bin\perl.exe -w use strict; use File::Find; use Carp; #variables my ($directory,$file,$text); print "Enter search text: "; $text = <STDIN>; chomp $text; $directory = 'c:\my_directory'; find (\&search,$directory); sub search { my $file = $File::Find::name; open (FILE, "$file") or carp "Guess what, it didn't work!\n$!"; my $line = <FILE>; close FILE; print "$text - $file" if $line =~ /$text/; }

I have numerous errors that I am trying to work my way through, but the one that I am trying to figure out right now is:
Permission denied at C:/Perl/lib/File/Find.pm line 450
(I am sure there are several other errors the monks can point out as well :-) )

Find.pm is in that folder and I have full access to it. I found this but I don't know enough to figure out if it is truly related or not. I am using PPM 3.0.1 if that helps....

Any help would be greatly appreciated.
Thanks so much!

2006-03-04 Retitled by planetscape, as per Monastery guidelines
Original title: 'Permission Denied'


In reply to 'Permission Denied' error from File::Find by witandhumor

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (9)
As of 2024-04-19 13:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found