Help for this page
# Get a list of all files in a given directory # Note use of the grep to exclude subdirectory names ... # Strip off any leading folder names so that # myfolder/file1.txt then becomes just file1.txt s/.*[\\\/]// for @files_in_dir;
my @matching_files = grep { $wanted{ $_ } } @files_in_dir;