in reply to use simple scalar names to point to specific array elements
You probably should look at Lexical::Alias.
The module appears to complain if you try to use it with a version of perl prior to 5.8.0, but there is a comment in the pod saying that thanks to a bug fix (by tye), it should now work with versions greater than 5.005.
Presumable it would be a case of modifying the test if you are using an earlier version.
Update: An example of use.
P:\test>perl -MLexical::Alias my( @a, $x, $y, $z ); @a = 'A' .. 'Z'; alias( $a[23], $x ); alias( $a[24], $y ); alias( $a[25], $z ); print "$x : $y : $z\n"; ^Z X : Y : Z
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: use simple scalar names to point to specific array elements
by Ovid (Cardinal) on Dec 05, 2003 at 20:53 UTC | |
|
Re: Re: use simple scalar names to point to specific array elements
by Sandy (Curate) on Dec 05, 2003 at 21:26 UTC |