in reply to Re: adding number to array name
in thread adding number to array name

That won't work for lexical variables, and it will piss off strict (with good reason.)

The far better choice is to use an array of arrays instead. See perldsc.

Update: See also Why it's stupid to `use a variable as a variable name'

Replies are listed 'Best First'.
Re^3: adding number to array name
by shmem (Chancellor) on Aug 23, 2006 at 21:57 UTC
    Of course. First I answered the OPs question, thenI was completing the node with my objection to the approach. You caught me whilst editing ;-)

    Maybe the other way round it's better - objection first?

    --shmem

    _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                  /\_¯/(q    /
    ----------------------------  \__(m.====·.(_("always off the crowd"))."·
    ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}