in reply to Re: Adding a number from scalar variable to array name
in thread Adding a number from scalar variable to array name

ug! Why compound the problem by needlessly using eval EXPR.
@numbers = (1,2,3,4); foreach $num (@numbers) { no strict 'refs'; @{"store_get$num"} = ($num); }

Replies are listed 'Best First'.
Re^3: Adding a number from scalar variable to array name
by Skeeve (Parson) on Sep 08, 2006 at 20:47 UTC
    Why? Cause TMTOWTDI!
    Why? Cause neither way is good.
    Why? Cause I'm a caveman.
    Why? Cause I've got eyes in the back of my head.
    Why? It's the heat. Standby.
    excerpt shamelessly cited from Laurie Anderson's "From the Air" ;-)

    s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%
    +.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`$''`"e