in reply to Speed comparison of foreach vs grep + map
Without looking at your timings, the second script is doing something different than the first script:
my @e = grep(/0/, @d);
This invokes the regex engine instead of comparing $_ to falsy values.
Maybe you meant to write something like:
my @e = grep(!$_, @d);
|
---|