good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
And yet another reason not to shell is that grep (albeit a more flexible variant) is available in Perl anyway, e.g.:
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! In reply to Re: Shell Commands executed in perl script
by Moron
|
|