in reply to Scope when initializing with references in a loop
Produces this:$array[0] = { val => "value number 0", one => 'undef' }; for my $i (1 .. 3) { $array[$i] = { val => rand(time)%3, one => \$array[0]{val} }; }
... which seems to be a bit more like what you wanted. But I'd love to know why you wanted it!# undef # SCALAR(0x176f1c4) # value number 0 # SCALAR(0x176f1c4) # value number 0 # SCALAR(0x176f1c4) # value number 0
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Scope when initializing with references in a loop
by IraTarball (Monk) on Dec 06, 2001 at 03:57 UTC |