in reply to Parse for a name after a keyword search in all the files, given directory as input

Hello prash_sri and welcome to the monastery and to the wonderful world of Perl!

This of traversing directory structure is one of the first question asked here in the monastery: node id 847

Please read elder's wisdom: see Recursive Directory print where I point to the tachyon's solution.

Note that since that time you can now use local variable to open dirs like open my $dir instead of bareword DIRHANDLE syntax

opendir my $path or die "unable to open '$path' dir for read!"

See opendir readdir telldir seekdir rewinddir and closedir pages.

L*

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
  • Comment on Re: Parse for a name after a keyword search in all the files, given directory as input
  • Select or Download Code