in reply to Re: array element return syntax
in thread array element return syntax

This also works.
For some meaning of "works", in the same sense that you can add "sleep 1" in various places in your program and it still "works", albeit slower.

There's no point in constructing an entire full-fledged array, then take a reference to it, then dereference that reference to get a particular element, then garbage collect the full array, just to get one element of it. It's a lot of extra work.

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

Replies are listed 'Best First'.
Re^3: array element return syntax
by kwaping (Priest) on Mar 29, 2006 at 15:57 UTC
    Thanks! That makes sense. It was just the first thing that sprang to my mind, but now I know better.

    ---
    It's all fine and dandy until someone has to look at the code.