in reply to Pick up specific file name
Hello JobyJ,
Welcome to the monastery. Why don't you try something like this? You can read more for module File::Find::Rule.
#!usr/bin/perl use strict; use warnings; use File::Find::Rule; sub get_files { my @dirs = ('/path1/path1', '/path2/path2'); # add more my $level = shift // 2; # level to dig into my @files = File::Find::Rule->file() ->name('*D602BG') ->maxdepth($level) ->in(@dirs); return @files; } my @files = get_files();
After that you can create a foreach loop on the files that you have returned. ;)
Hope this helps, BR.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Pick up specific file name
by Laurent_R (Canon) on Jul 07, 2017 at 17:51 UTC |