home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cs.utexas.edu!usc!news!netlabs!lwall
- From: lwall@netlabs.com (Larry Wall)
- Newsgroups: comp.lang.perl
- Subject: Re: [Q] Ref. to array element ?
- Message-ID: <1992Dec11.171440.7890@netlabs.com>
- Date: 11 Dec 92 17:14:40 GMT
- References: <1992Dec9.153252.16741@siemens.co.at> <1992Dec10.013324.2328@yarra-glen.aaii.oz.au> <1992Dec10.075930.28572@cs.ruu.nl>
- Sender: news@netlabs.com
- Organization: NetLabs, Inc.
- Lines: 22
- Nntp-Posting-Host: scalpel.netlabs.com
-
- In article <1992Dec10.075930.28572@cs.ruu.nl> piet@cs.ruu.nl (Piet van Oostrum) writes:
- : >>>>> pem@yarra-glen.aaii.oz.au (Paul E. Maisano) (PEM) writes:
- :
- : PEM> Here's a sub that will return the symbol table entries (globs?)
- : PEM> for each scalar passed.
- :
- : PEM> Eg. (*a, *b) = &ref($x, $y[1])
- :
- : PEM> `a' now refers to whatever `x' did and `b' should refer to whatever
- : PEM> y[1] did.
- :
- : PEM> I wrote it a long time ago but I have never used it for anything.
- : PEM> It uses the fact that the grep function makes $_ a reference to each
- : PEM> scalar in the given array.
- :
- : Will this also work in perl 5?
-
- There's a good chance of it, though you should realize that it probably
- generates symbol table entries that are rarely (if ever) reclaimed.
- It would likely be better to use real references in Perl 5.
-
- Larry
-