Better explanation - Adding to Mult-dimensional array of arrays

2003-01-15 Thread Liss, Mike
Sorry for the confusing post, here is a little better explanation: I am trying to create multi-dimensional arrays $MyArray[ 2 ][]; So I can do this: $MyArray[ 0 ][ 0 ] = 2; $MyArray[ 0 ][ 1 ] = 3; $MyArray[ 0 ][ 0 ] = 4; $MyArray[ 1 ][ 1 ] = 5;

RE: Better explanation - Adding to Mult-dimensional array of arrays

2003-01-15 Thread Mark Anderson
> But what I really want to do is this : > > push( @MyArray[0], 2 ); > push( @MyArray[0], 3 ); > > push( @MyArray[1], 4 ); > push( @MyArray[1], 5 ); > push( @MyArray[1], 6 ); I apologize. My first response was incorrect. You need: push( @{$MyArray[0]}, 2 )

Re: Better explanation - Adding to Mult-dimensional array of arrays

2003-01-15 Thread Rob Dixon
Mike Liss wrote: > I am trying to create multi-dimensional arrays > > $MyArray[ 2 ][]; > That's meaningless in Perl, but anyway... > > So I can do this: > > $MyArray[ 0 ][ 0 ] = 2; > $MyArray[ 0 ][ 1 ] = 3; > > $MyArray[ 0 ][ 0 ] = 4; > $MyArray[ 1 ][ 1 ] = 5; > $MyArray[ 2 ][ 2 ] = 6; > > > But

Re: Better explanation - Adding to Mult-dimensional array of arrays

2003-01-15 Thread John W. Krahn
Mike Liss wrote: > > Sorry for the confusing post, here is a little better explanation: > > I am trying to create multi-dimensional arrays > > $MyArray[ 2 ][]; > > So I can do this: > > $MyArray[ 0 ][ 0 ] = 2; > $MyArray[ 0 ][ 1 ] = 3; $MyArray[ 0 ] = [ 2, 3