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-
In reply to Re: reference to array element?
by gjb
in thread reference to array element?
by Flame
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |