Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!cs.utexas.edu!uunet!bfmny0!tneff From: tneff@bfmny0.UU.NET (Tom Neff) Newsgroups: comp.lang.perl Subject: Re: Variable variables Message-ID: <15175@bfmny0.UU.NET> Date: 16 Feb 90 00:22:04 GMT References: <29987@sparkyfs.istc.sri.com> Reply-To: tneff@bfmny0.UU.NET (Tom Neff) Lines: 15 In article <29987@sparkyfs.istc.sri.com> zwicky@sparkyfs.itstd.sri.com (Elizabeth Zwicky) writes: >I have an array, @devices, consisting of a list of device names read >from the command line. For each of those devices, I need an array >consisting of the machines supposed to be backed up to that device. You could use 'eval' to create arrays whose names were derived from the device names, and to refer to their contents later on. Another approach would be to create an associative array, indexed by device name, where the associated element is a string of the form "machine1,machine2,machine3...". The 'join' and 'split' operators make the transformation between a string of this form and a straight @machines array straightforward. I would go with the second approach.