in reply to Re: Reading Multiple Directories
in thread Reading Multiple Directories

I like this way better, it seems to have less over head or code any way, but I need to do one more test before "pushing" the files into @files. Test for file size, trying this way, but not really sure if its efficient.
use warnings; use strict; use Data::Dumper; use File::Slurp qw(read_dir); my @files; my @directories = ( '/dir1', '/dir1/imgs' ); for my $d (@directories) { push @files, grep { -f "$d/$_" } read_dir($d); foreach my $file(@files) { my $filesize = -s $d.$file; #need to check if file is > then 0 and less then 2M; } }
Thanks once again!