use Text::CSV; use HTML::Entities; sub ConvertData { my $csv = Text::CSV->new ({ binary => 1, auto_diag => 1 }); open my $fh, "<", $Filename or die "Couldn't open location file $Filename: $!"; my @report = (""); while (my $row = $csv->getline ($fh)) { push @report, ""; push @report, "" for @$row; push @report, ""; } push @report, "
", encode_entities ($_), "
"; close $fh; return join "\n" => @report; }