Newsgroups: comp.lang.perl Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sdd.hp.com!elroy.jpl.nasa.gov!jpl-devvax!lwall From: lwall@jpl-devvax.jpl.nasa.gov (Larry Wall) Subject: Re: using contents of a scalar variable as a variable name Message-ID: <1991Apr13.042043.9023@jpl-devvax.jpl.nasa.gov> Reply-To: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Organization: Jet Propulsion Laboratory, Pasadena, CA References: <1991Apr12.023355.2449@iwarp.intel.com> Date: Sat, 13 Apr 1991 04:20:43 GMT In article <1991Apr12.023355.2449@iwarp.intel.com> merlyn@iwarp.intel.com (Randal L. Schwartz) writes: : Sure, use symbolname assignment (or whatever it's called...): : : *NAME = $names[0]; : : $NAME = "something"; : : Warning: this hides @NAME, %NAME, &NAME, and the NAME filehandle (did : I leave anything out???), so use carefully. You left out the NAME format, the NAME directory handle, and all the special variables bound to the NAME filehandle by select. NAME also loses any magical significance: *ENV = 'foo' would turn %ENV into a normal array, I believe. (Although it's still forced to be a global variable by the symbol table routines.) Larry