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
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
> 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 )