in reply to What came (in) first, the push or the splice?

A couple of notes:

Unless you plan on working with very long lists, I'd use splice_it. It's the easiest to read of the solutions with similar performance. (And this "unless" prooves your point.)

Replies are listed 'Best First'.
Re^2: What came (in) first, the push or the splice?
by wazzuteke (Hermit) on May 08, 2006 at 16:43 UTC
    All good points and I'm glad you brought them up. I guess the broader point I was trying to make was to make sure you dig your mind into the scope of the real problem. There are a number of things that will change your problem, inlcuding the reliability of (in this case ) @cp (in my case it will very reliably be either an empty list or an AoH), the Perl version you're running, etc.

    Aggreed that splice_it is the best way for my case as well. I guess I was trying to express less of the best solution for my problem, but rather the worthyness of investigating multiple solutions for all problems in a more general sence.

    print map{chr}(45,45,104,97,124,124,116,97,45,45);
    ... and I posted this while I was at work => whitepages.com | INC