Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!tut.cis.ohio-state.edu!oz.cis.ohio-state.edu!jgreely From: jgreely@oz.cis.ohio-state.edu (J Greely) Newsgroups: comp.lang.perl Subject: Re: Variable variables Message-ID: Date: 15 Feb 90 21:12:44 GMT References: <29987@sparkyfs.istc.sri.com> <1990Feb15.195712.6845@iwarp.intel.com> Sender: news@tut.cis.ohio-state.edu Reply-To: J Greely Organization: Ohio State University Computer and Information Science Lines: 37 In-reply-to: merlyn@iwarp.intel.com's message of 15 Feb 90 19:57:12 GMT In article <1990Feb15.195712.6845@iwarp.intel.com> merlyn@iwarp.intel.com (Randal Schwartz) writes: >In article <29987@sparkyfs.istc.sri.com>, zwicky@sparkyfs (Elizabeth Zwicky) writes: >| foreach $device (@devices){ >| @$device = something; >| } >for $device (@devices) { > eval '@' . $device . ' = something'; >} Just for fun, if you want to do more complicated things to the individual elements, here's a twisted example that uses my favorite Perl feature: @devices=("dev1","dev2"); @dev1=("dev1.1","dev1.2"); @dev2=("dev2.1","dev2.2"); grep(eval <