Path: utzoo!attcan!uunet!wuarchive!decwrl!ogicse!iwarp.intel.com!news From: merlyn@iwarp.intel.com (Randal L. Schwartz) Newsgroups: comp.lang.perl Subject: Re: perl -s and -foo=23 or -bar-17 Message-ID: <1991Jan12.090110.2487@iwarp.intel.com> Date: 12 Jan 91 09:01:10 GMT References: <1991Jan12.073433.19925@athena.mit.edu> Sender: news@iwarp.intel.com Reply-To: merlyn@iwarp.intel.com (Randal L. Schwartz) Organization: Stonehenge; netaccess via Intel, Beaverton, Oregon, USA Lines: 31 In-Reply-To: ccount@athena.mit.edu (Craig A Counterman) In article <1991Jan12.073433.19925@athena.mit.edu>, ccount@athena (Craig A Counterman) writes: | I guessed that the variable 'foo=23' | was created and given the value 1. This is a rather useless | (inaccessable) variable! (a local perl (relative) expert just tought | me how to access it through *baz, e.g. *baz = $_main{"foo=23"};print | $baz; | ) Simpler than that: $NormalMerlyn = 50; *X = 'Funky Variable 1, Merlyn'; $X = 100; *X = 'Another // Funky, Merlyn'; $X = 200; print "Vars are: ", join(":",grep(/Merlyn$/, keys _main)), "\n"; *Z = 'Funky Variable 1, Merlyn'; print "fv1 = $Z\n"; *Z = 'Another // Funky, Merlyn'; print "a/f = $Z\n"; | I'm anxious to get a copy of the Book. I've gotten so much excellent | use from perl in the past year (exactly, now that I think of it), and | still find that I use about 40% of the language. Thanks for the testimonial even before getting your hands on it. Larry and I both hope that you find what you are looking for in The Book. $W="X10"; for (split(/Z*/,"Just another Perl hacker,")) {*X = $W++; $X = $_;} eval 'print $X'.join(',$X', 10..35) -- /=Randal L. Schwartz, Stonehenge Consulting Services (503)777-0095 ==========\ | on contract to Intel's iWarp project, Beaverton, Oregon, USA, Sol III | | merlyn@iwarp.intel.com ...!any-MX-mailer-like-uunet!iwarp.intel.com!merlyn | \=Cute Quote: "Intel: putting the 'backward' in 'backward compatible'..."====/