#First, we create an array to store the file information and use the
#glob function to pull in information on all files from our subfolder.
@myarray = glob('subfolder/*.');
#Then we can print our array to return all files in the subfolder
print "@array\n";
The question is, how do we get it to return specific values based on a particular file extension? Simple, look at the code in bold below:
#First, we create an array to store the file information and use the
#glob function to pull in information on all .txt files
#from our subfolder.
@myarray = glob('subfolder/*.txt');
#Then we can print our array to return all files in the subfolder
print "@array\n";
Its an easy way to only pull in files of a specific extension using PERL!