in reply to Memory issue with large array comparison
my @list = grep { my $x = $_; not grep { $x =~ /$_\w+$/ } @safe_list } @pathnames;
the first grep from the left should probably be a map instead.
Chris
Update: Didn't read the code correctly.