eatthatquestion has asked for the wisdom of the Perl Monks concerning the following question:
running this code gives 9 2 9 -3.@a=([0,1,2]); @b=([-1,-2,-3]); unshift @a,1; $a[0][0]=4; $a[0][1]=5; $a[0][2]=6; unshift (@b,1); $b[0][0]=7; $b[0][1]=8; $b[0][2]=9; print $a[0][2]; print $a[1][2]; print $b[0][2]; print $b[1][2];
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: unshift with two-dimensional arrays
by ikegami (Patriarch) on Oct 26, 2007 at 11:12 UTC | |
|
Re: unshift with two-dimensional arrays
by johngg (Canon) on Oct 26, 2007 at 11:20 UTC | |
|
Re: unshift with two-dimensional arrays
by jettero (Monsignor) on Oct 26, 2007 at 10:56 UTC | |
|
Re: unshift with two-dimensional arrays
by syphilis (Archbishop) on Oct 26, 2007 at 12:56 UTC | |
|
Re: unshift with two-dimensional arrays
by Anonymous Monk on Oct 26, 2007 at 18:02 UTC | |
by erroneousBollock (Curate) on Oct 26, 2007 at 18:47 UTC |