in reply to Populating Arrays of Arrays
#!/usr/bin/perl use warnings; use strict; use diagnostics; use Data::Dumper; my @contents = ( [qw/html head body/], [qw/font face size color/], [qw/h1 p code/]); my @ctags; foreach my $row (@contents) { #$row will now be an array reference; #print Dumper $row; # if you want to see foreach my $value (@$row) { push @ctags, "<\\$value>"; } } print Dumper(\@ctags);
To be honest, I'm not sure of your actual intentions in the scalarclose line, and the rest of the code features a lot of redundancy. What are your ultimate intentions? How close is this to doing what you want?
Hint: Using Data::Dumper is a great way to see your variables' values.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Populating Arrays of Arrays
by dReKurCe (Scribe) on Mar 03, 2005 at 19:55 UTC | |
by davis (Vicar) on Mar 03, 2005 at 20:03 UTC |