#!/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.
In reply to Re: Populating Arrays of Arrays
by davis
in thread Populating Arrays of Arrays
by dReKurCe
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |