in reply to list two paths files into one array
Otherwise, what you can do is to store the entries of the first dir into an array, and then add the entries of the second one to this array. Something like this:
Of course, this can be made somewhat shorter:my $Dir1 = "d:/xxxxxx"; my $Dir2 = "d:/yyyyyy"; my @files = glob ("$Dir1/*"); for my $file (glob "$Dir2/*" ) { push @files, $file; } for my $file (@file) { print $file, "\n" }
my $Dir1 = "d:/xxxxxx"; my $Dir2 = "d:/yyyyyy"; my @files = glob ("$Dir1/*"); push @files, $_ for glob "$Dir2/*"; print $_, "\n" for @file;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: list two paths files into one array
by pryrt (Abbot) on Nov 14, 2017 at 00:54 UTC | |
by Laurent_R (Canon) on Nov 14, 2017 at 08:28 UTC |