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. }
In reply to Re^3: Is there a better way to check if an array is empty?
by Marshall
in thread Is there a better way to check if an array is empty?
by iphone
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |