in reply to Re^2: The most efficient way for searching for an element in an array?
in thread The most efficient way for searching for an element in an array?

choroba :)

1) yep it's OR condition. 2) yep full scan not perfect but not returned. Maybe there is an operator to quit the grep... I will check
  • Comment on Re^3: The most efficient way for searching for an element in an array?

Replies are listed 'Best First'.
Re^4: The most efficient way for searching for an element in an array?
by Discipulus (Canon) on Jan 08, 2016 at 09:32 UTC
    2) No you cannot break map grep sort just because they are not loops!

    L*
    There are no rules, there are no thumbs..
    Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
      in fact there is a loop (in sort, map, grep) but no internal checks to escape like single match...
        I dont know perl's internals but i think to those functions as 'list returner'. No loop is involved as in @array = qw(a b c); Can you brake the assignement after 'b' is reached? No. The same for map grep and sort.

        L*
        There are no rules, there are no thumbs..
        Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.