use strict; use warnings; use HTML::TableExtract; my $te = HTML::TableExtract->new (); $te->parse (< Cell 1Cell 2Cell 3 Cell 4Cell 5Cell 6 HTML my $table = $te->first_table_found; my @totalrows = $table->rows (); print "$_->[0] - $_->[1] - $_->[2]\n" for @totalrows; #### Cell 1 - Cell 2 - Cell 3 Cell 4 - Cell 5 - Cell 6 #### my @totalrows = map {my $cells = $_; $_ ||= '***' for @{$cells}[0 .. 2]; $cells} $table->rows (); #### Boss - Firstname Surname - *** Secretary - Name Surname, Mr Jones Smith - *** Medical Doctor - Bob Middlename Hope - *** Position 1 - Worker - Secretary *** - Asdf Ghjk - Name Lastname, First Last *** - Sally Mally - Joe Smoe, The Who, Will Timberland Position 2 - Paula Simon - Raymonde Maalouf