in reply to use simple scalar names to point to specific array elements
This will do what you ask for:
for my $fifthele($myarray[5]) { # inside this loop body, $fifthele is an alias to $myarray[5] $fifthele = 123; }
I wish Perl had a more appropriate keyword, then people would feel more at ease using this idiom, but let me assure you: it works fine, and it's 100% reliable.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: use simple scalar names to point to specific array elements
by ambrus (Abbot) on Dec 08, 2003 at 19:08 UTC |