gpssana has asked for the wisdom of the Perl Monks concerning the following question:
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Unable to read the sub direcctory using perl?
by thanos1983 (Parson) on Apr 18, 2017 at 08:11 UTC | |
Hello gpssana, Can you read (How do I post a question effectively?) and update your question? Help us to help you, what you have tried? Errors? Help us replicate your problem. Something like "Unable to read the sub direcctory using perl?" does not mean anything. Update: I did a bit of search and I found this tutorial (Directory Recursion) written from the community. I have created a sample of code that reads my directory and sub directory and prints the contents that match my search. Sample of code taken and modified from the tutorial:
Update2: modifying DIR to my $dh. Hope this helps.
Seeking for Perl wisdom...on the process of learning...not there...yet!
| [reply] [d/l] [select] |
Re: Unable to read the sub direcctory using perl?
by thanos1983 (Parson) on Apr 19, 2017 at 08:23 UTC | |
Hello gpssana, Your question looks better now, but try to provide us with a bit more information. What is $word on your code, provide us with sample of desired output. From what I see from your code, it is not clear for me what you are trying to do. Is it possible to write some high level description, (e.g. step one open my path, step two read directories and search for directories that start with (rev*), step three retrieve all html Also when you are trying to come up with a solution focus on the part of your code that is not working. What I mean comment out all parts that they do not play a vital role on your solution yet, focus on the line that you have a problem until you get the desired result and then proceed to the next step not all together. Update: I checked the tutorial that I post yesterday, and I am wondering at this point if you read it. I am asking because more or less contains 80%-90% of your desired solution. Sample of code modified to meet your criteria, taken from the tutorial.
I created a sample of index.html file trying to replicate your problem (sample of file bellow).
So I added the file in my directory and simply copied and applied minor minor modifications from the tutorial that I provide you (Directory Recursion). Sample of code with output.
Update your question based on the steps that I described above, also provide us with the error message that you are getting and the desired output. Sample of code that I provided you more or less should solve your problem by 90%. Hope this helps.
Seeking for Perl wisdom...on the process of learning...not there...yet!
| [reply] [d/l] [select] |
Re: Unable to read the sub direcctory using perl?
by Anonymous Monk on Apr 18, 2017 at 20:25 UTC | |
"Developing in Windows is easy just use \ instead of / and / instead of \" -Ron Smith | [reply] |