in reply to Combining arrays with grep/unless?
Beyond the fact that you should use one of the more efficient solutions given by others, your error lies in the test given to grep:
... grep { $hit } @group1;
This tests if $hit is true, which always happen in your input data. You should have written:
... grep { $_ eq $hit } @group1;
which does compare each item in @group1 with $hit.
Flavio
perl -ple'$_=reverse' <<<ti.xittelop@oivalf
|
|---|