in reply to incremental additions to multidimensional arrays

perldoc perlref
perldoc -f push
perldoc -f ref
  • Comment on Re: incremental additions to multidimensional arrays

Replies are listed 'Best First'.
Re^2: incremental additions to multidimensional arrays
by Anonymous Monk on Jun 14, 2007 at 04:45 UTC
    yeah, except that push simply adds the new item to the end of the array.

    it would be nice if this worked:

    my ($ref,$monk); $ref->[2]->[1] = "value"; $ref->[3]->[2] = "value"; $monk->[1]->[3] = "value"; push @{ $ref }, $monk;
    and a new entry
    $ref->[1]->[3]

    was created. But instead, this array "monk" is added as

    $ref->[4]

    thank you for your time and effort