in reply to Variable usage

I would like to know which of the following loops is more efficient

No, you would not like to know that. Don't try to prematurely optimize please.

Replies are listed 'Best First'.
Re^2: Variable usage
by ChemBoy (Priest) on Mar 05, 2009 at 07:34 UTC

    If the OP were to persist in prematurely optimizing, of course, the only thing you could meaningfully optimize this code for would be the number of bytes of code, in which case the naive solution for the critical section would be

    $\ = $/; print foreach (@numbers);
    Though at that point, we've opened the door into whole new realms of time-wasting. ;-)



    If God had meant us to fly, he would *never* have given us the railroads.
        --Michael Flanders

      $, = $\ = $/; print @numbers;
      Or in 5.10...