in reply to Re: Dependant Arrays intersection
in thread Dependant Arrays intersection

thanks Muskrat, already implemented your code, but since @big const 400k elements, 1 or worster 2 nested cycles , take very much time

Replies are listed 'Best First'.
Re^3: Dependant Arrays intersection
by Mr. Muskrat (Canon) on Feb 04, 2016 at 22:08 UTC

    Did I miss your examples or did you add them later? If all of the fragments in your small array will match the end of an item in the large array then you should anchor the search at the end with a $ like you had in your grep.

    push @selected, $item if any { $item =~ /\Q$_\E$/ } @small;