From here
#!/usr/bin/perl
my @arr = ('/usr/test/test-[\d.*].*.con');
How to support the searching file based on regular expression
From here
#!/usr/bin/perl
my @arr = ('/usr/test/test-[\d.*].*.con');
How to support the searching file based on regular expression
If I understand your question, here's one way to do it: use glob
to find all files in the directory and grep
to filter them.
my $dir = '/usr/test';
my @files = grep { /REGEX_HERE/ } glob("$dir/*");
you can use File::Find for doing exactly this.
use File::Find;
my @files = ();
find( sub {/test-[\d.*].*.con/ && push @files, $File::Find::name}, '/usr/test' );
print foreach (@files);