Hello Monks
any ideas of how to get list of files matching part of filename. ex: get filenames sample.txt or sample123.txt
use strict; use warnings; use File::Basename; use Data::Dumper; my @files = glob(".* *"); my $dir = '/home/test'; foreach my $file ( @files ) { next if ( $file eq '.' or $file eq '..' ); my @matches = glob("$dir/$file*"); if ( @matches ) { print Dumper(@matches); } }
This isn't doing what i expected. Any ideas are appreciated
In reply to get list of files matching part of file name by doubledecker
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |