in reply to sharing array of arrays between threads
See perlreftut for more information.$ perl -d -e 1 DB<1> $X = [ 1 .. 10 ]; # create a reference to an anonymous array DB<2> x $X # print the array by its reference 0 ARRAY(0x9a45510) 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 DB<3> @X = ( 2 .. 20 ); # create an array DB<4> x @X # display the array 0 2 1 3 2 4 3 5 4 6 5 7 6 8 7 9 8 10 9 11 10 12 11 13 12 14 13 15 14 16 15 17 16 18 17 19 18 20 DB<5> x @X[1] # display an element of the array 0 3 DB<6> x $X->[1] # display an element of the anonymous array by its r +eference 0 2
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: sharing array of arrays between threads
by bebe (Novice) on Aug 10, 2012 at 23:32 UTC | |
by aitap (Curate) on Aug 11, 2012 at 08:25 UTC |