Hi nirelit,
Any ideas on how would you approach this?
One way is to use the core module File::Find, you can get the full filename of each found file from the variable $File::Find::name, and use File::Spec's splitdir to split the filename into its components. The reverse index could be done with a hash, assuming there's enough memory for all the entries to fit in.
That's just one way, there are also the modules File::Find::Rule, Path::Class, or Path::Tiny, but the above has the advantage that it uses only core modules. The advantage of Path::Class and Path::Tiny is that they also have methods built in to slurp the files, which would make creating your index files a little bit easier.
Hope this helps,
-- Hauke D
In reply to Re: creating an index of files contents
by haukex
in thread creating an index of files contents
by nirelit
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |