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

Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail
Hooray!
Wanted!

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

    Sweet! Yet another module to make my code harder to understand :) One day I need to just sit down and start reading through the CPAN to find all of those odd little modules that I don't know about.

    Cheers,
    Ovid

    New address of my CGI Course.

Re: Re: use simple scalar names to point to specific array elements
by Sandy (Curate) on Dec 05, 2003 at 21:26 UTC
    Looks like it might be exactly what I want. Thankyou.

    Sandy