in reply to Shell Commands executed in perl script

And yet another reason not to shell is that grep (albeit a more flexible variant) is available in Perl anyway, e.g.:
print join ("\n", grep !(( -d $_ ) || /^file1$/ ), glob './logs/*' ) . + "\n";
n.b. your original code will exclude any file for which file1 is a substring found anywhere in the ls -l line for the file - that's a lot of potential holes ... /^files1$/ operating on what the glob returns closes them all, /file1/ would exclude also any file where file1 is any substring of the filename. That seems almost but not quite as unlikely to DWYM under rigorous testing.
__________________________________________________________________________________

^M Free your mind!