in reply to reference to array element?
The following code does what I would expect, it works ;-)
#!perl use strict; use warnings; my @array = (1..10); print $array[2], "\n"; # prints 3 my $ref = \$array[2]; $$ref = 11; print $$ref, "\n"; # prints 11 print $array[2], "\n"; # prints 11
If your code doesn't do something similar, it would help to post the actual fragment.
Hope this helps, -gjb-
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: reference to array element?
by Flame (Deacon) on Jan 30, 2003 at 02:27 UTC | |
|
Re: Re: reference to array element?
by Flame (Deacon) on Jan 30, 2003 at 02:14 UTC |