Hello,
I would need your help,
I have a Perl code that makes a folder structure, it reads a txt and creates the folders
Now I have an issue I have to go through this folder structure and insert a file delete_me txt is yhe lowest level, and I have many lowest levels.
How do I search?
mibushk 0 Newbie Poster
Recommended Answers
Jump to Postuse File::Find; ### Declare your path my $dir = "d:/muthu"; ### travel the $dir path find(\&get_lowest_folder, $dir); ### Now the lowest level folder info in array @low print "\n$_" for @low; sub get_lowest_folder { if (-d) # check current path is a directory { ### save current …
Jump to Postk_manimuthu, I think your script overlooks the last directory entered by the File::Find. I understand that your subroutine compares each current directory with the previous, and prints the previous if it is not equal to the first part of the current. But I don't think the last directory entered by …
Jump to PostHi David,
What do you told that’s absolutely right. When I checked my script, I looked into 1, 2, 3, 4 ….. I missed out to check the N'th term. Thanks for your point out.
-Mani Muthu
All 9 Replies
d5e5 109 Master Poster
mibushk 0 Newbie Poster
k_manimuthu 43 Junior Poster in Training
d5e5 109 Master Poster
d5e5 109 Master Poster
k_manimuthu commented: Very Good Analyze +1
k_manimuthu 43 Junior Poster in Training
d5e5 109 Master Poster
mrcool1976 0 Newbie Poster
d5e5 109 Master Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.