in reply to reg expression
foreach my $file (@filelist) { push(@curr, $1) if $file =~ /^(FRAUD-REPORT\d+\.CSV)$/i; }
Furthermore, you can simplify things a bit if you're trying to match the entire string (as per wazoox's post):
foreach my $file (@filelist) { push(@curr, $file) if $file =~ /^FRAUD-REPORT\d+\.CSV$/i; }
or just
my @curr = grep /^FRAUD-REPORT\d+\.CSV$/, @filelist;
|
|---|