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

sub table(){ my $decl = RTF::Writer::TableRowDecl->new('widths' => [1500,1900, +1900]); foreach my $outer (@tableData) { foreach my $inner (@{$tableData[$outer]}) { $fh->row($decl, $inner) } } } OR sub table(){ my $decl = RTF::Writer::TableRowDecl->new('widths' => [1500,1900, +1900]); foreach my $i (0 .. $#tableData) { foreach my $j (0 .. $#{$tableData[$i]}) { $fh->row($decl, $tableData[$i]->[$j]) } } } OR as an arrayref my $tableData = [ # note square bracket ['this', "that", 'jhsdfhjsa'], ["that", "this", 'kjhsadfh'], ["me", "none", 'slhdfjhsf'], ]; # note square bracket then later: $fh->row($decl, $tableData->[$i]->[$j])