I'm trying to fill a Perl array with a list of file names in a directory,$dir, and I want to exclude directories. My code is:
my @lsArray = `ls -p $dir | grep -v '/$'`;
But it creates this error:
sh: -c: line 0: unexpected EOF while looking for matching `''
sh: -c: line 1: syntax error: unexpected end of file
I cant seem to find a combination of quotes which does this correctly. Thanks....