I am having an issue when doing array comparisons on large arrays. Basically I one array which contains a large list (50,000+) of filepaths ex. C:/abc/abc1/GS12345 then I have another large array (10,000+) ID's like GS12345.
I am using some code I found on here to create a new array that contains pathnames in which the id after the last slash in the pathname doesn't match any of the id's in the array of id's.
The problem is this runs out of memory on large lists, it works fine on smaller lists like 2,000 pathnames vs. 1,000 ID's.
Here is my code: my @list = grep { my $x = $_; not grep { $x =~ /$_\w+$/ } @safe_list } @pathnames;In reply to Memory issue with large array comparison by bholcomb86
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |