in reply to Re^2: Is there a better way to check if an array is empty?
in thread Is there a better way to check if an array is empty?

This "code" is gobbledygook. @array is not needed. Grep in a scalar context returns the number of matches.
my @files = (.....some file names...); my %hash = (....keyed upon file names...); my @newfiles; foreach my $file (@files) { push (@newfiles, $file) unless ( grep{/\Q$file\E/}keys %hash ); # pushes the name of $file to @newfiles if no match # is found to the pattern within keys of %hash. }