in reply to Get AoH values into array

Loops solve in linear time with the number of elements tested. Generally, you don't need to worry about the inefficiencies of single loops, unless you are processing huge data sets.

Worry about loop inefficiencies when you have loops inside loops and your solution time is quadratic (N2).

Or worse.

throop

Replies are listed 'Best First'.
Re^2: Get AoH values into array
by Anonymous Monk on Sep 07, 2007 at 08:09 UTC
    Thank you monks

    I'm not worried about the inefficiency of loops, my data set is not large. It was just that once I learned that I can put 2 arrays into a hash like this

    my %h; @h{@a}=@b;
    I sort of hoped there were other loop avoiding constructs to learn.. Loops are so c.

    Cheers
    Weevil