Perl :
opendir ( SOURCEFILEDIR, $SrcFileDir) or die "Could not open '$SrcFileDir' : $!";
my @array;
while (my $file = readdir(SOURCEFILEDIR)) {
next unless (-f "$SrcFileDir/$file");
#*.log files
if (rindex($file,'.log')== -1){
push @array, $file;
}
# *.err files
if (rindex($file,'.err')== -1){
push @array, $file;
}
}
closedir(SOURCEFILEDIR);