Path: utzoo!attcan!uunet!ns-mx!iowasp!ceres!zaphod.mps.ohio-state.edu!think!mintaka!ogicse!decwrl!ucbvax!iwarp.intel.com!news From: merlyn@iwarp.intel.com (Randal Schwartz) Newsgroups: comp.lang.perl Subject: Re: Creating a reference to an array index Message-ID: <1990Mar17.183039.21097@iwarp.intel.com> Date: 17 Mar 90 18:30:39 GMT References: <1361@frankland-river.aaii.oz.au> Sender: news@iwarp.intel.com Reply-To: merlyn@iwarp.intel.com (Randal Schwartz) Organization: Stonehenge; netaccess via Intel, Beaverton, Oregon, USA Lines: 32 In-Reply-To: pem@frankland-river.aaii.oz.au (Paul E. Maisano) In article <1361@frankland-river.aaii.oz.au>, pem@frankland-river (Paul E. Maisano) writes: | So in my search for neatness (or any kludge that would work) I came up | with the following: | | grep(*vptr = *_, $ary[1]) | # manipulate $vptr and modify the array [...] | Now I am content and can sleep again at nights. | But I am too tired to work out how to generate "Just Another Perl Hacker," | using it. Randal ? :-) Something like this? @ARGV=split(//,'Just another Perl hacker,');push(@x,'')while@x<@ARGV; for$x($[..$#x){grep(*y=*_,$x[$x]);$y=shift;}print@x; (Okay, so it's pretty simplistic...) But it'd be much easier to do: @ARGV=split(//,'Just another Perl hacker,');push(@x,'')while@x<@ARGV; for$y(@x){$y=shift;}print@x; So I still don't know why you want to alias an element like that. :-( By the way, I tried to preextend the array with $#x=$#ARGV, and it didn't work. Why not? print "Just another Perl hacker,"; # to make larry's code happy :-) -- /=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: "Welcome to Portland, Oregon, home of the California Raisins!"=/