in reply to Re^5: 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?

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.

Replies are listed 'Best First'.
Re^7: The most efficient way for searching for an element in an array?
by choroba (Cardinal) on Jan 08, 2016 at 11:54 UTC
    For your amusement (I know you love tying):

    Update: fixed splice.

    Update 2: Acme::Array::MaxSize.

    ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,