http://www.perlmonks.org?node_id=755849


in reply to Push function

Note that you don't need to 'make space'. Consider:

use strict; use warnings; use Data::Dump::Streamer; my @arr = ([11, 22, [[]]], [333, 444, []], [6666, 7777, []]); push @{$arr[0][2][0]}, 3; Dump \@arr; @arr = ([11, 22], [333, 444], [6666, 7777]); push @{$arr[0][2][0]}, 3; Dump \@arr;

Prints:

$ARRAY1 = [ [ 11, 22, [ [ 3 ] ] ], [ 333, 444, [] ], [ 6666, 7777, [] ] ]; $ARRAY1 = [ [ 11, 22, [ [ 3 ] ] ], [ 333, 444 ], [ 6666, 7777 ] ];

True laziness is hard work