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.
In reply to Re: Pick up specific file name
by thanos1983
in thread Pick up specific file name
by JobyJ
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |