my @rows; foreach my $no (qw( one two three )) { push @rows, $query->td( $no ); } print $query->table( $query->Tr( \@rows ) );