Iam trying to load the full path of multiplie files in the same directory to an array if the filenames matches a pattern. The following is the current code;
where $input=C:\test
# change to and open the comparison directory
chdir("$input2") || die "Cannot change dir: $!";
opendir(DIR2, "$input2") || die "Cannont open dir: $!";
# read flie names to an array with user specified path
foreach $file2 (readdir DIR2)
{
if($file2 =~ /lds/)
{
@files2 = join("\\", $input2,$file2);
}
}
close(DIR2);
The above code is only returning the last file in the directory with the full path.
Any suggestions on how to accomplish this?