use strict; use warnings; use Data::Dumper; # $msglines is a reference to an array my $msglines = [ qw(a b c) ]; # This pushes an array ref into an array, # creating an Array-of-arrays data structure my @msgs; push @msgs, $msglines; print Dumper(\@msgs); print "Size of first array ", scalar @{ $msgs[0] }, "\n"; __END__ $VAR1 = [ [ 'a', 'b', 'c' ] ]; Size of first array 3
See also:
In reply to Re: Push into an array inside a array
by toolic
in thread Push into an array inside a array
by baski
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |