TASdvlper has asked for the wisdom of the Perl Monks concerning the following question:
I have a array reference, which points to other arrays. What I would like to do is to add more data to the array before I print it out.
print code:
for my $col (@array) { for my $row (@$col) { print "$row\n"; } }
say I have a new array
How do I add that to array @array ? I'm probably overlooking over something easy. I know I can't use 'push' because the elements of @array are references.my @new_array = qw ( foo bar foobar barfoo );
Any help would be appreciated.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Adding elements to a array reference
by Abigail-II (Bishop) on Jan 15, 2004 at 15:22 UTC | |
by TASdvlper (Monk) on Jan 15, 2004 at 19:37 UTC | |
|
Re: Adding elements to a array reference
by Roy Johnson (Monsignor) on Jan 15, 2004 at 15:27 UTC | |
by TASdvlper (Monk) on Jan 15, 2004 at 19:35 UTC |