my $te; $te = HTML::TableExtract->new( headers => [qr/Month\s*/, qr/First\s*/, qr/High\s*/, qr/Low\s*/, qr/Sett\s*/, qr/Chg\s*/, qr/Vol\s*/, qr/GOWAVE\*\s*/] ); $te->parse_file($sourcefile); my ($row, $record); open (DATFILE, ">> meg.dat") or die "Unable to open meg.dat: $!"; print DATFILE "Table:\n"; foreach $row ($te->rows) { #code failed at this line $record = join(',', @$row); print DATFILE $record . "\n"; } close DATFILE;