#!/usr/bin/perl use strict; use warnings; use HTML::TableExtract; my $html = "100 - 2000\n
info\n
john\n
kent
"; my $table = 'HTML::TableExtract'->new(); $table->parse($html); print "Content-type: text/text\n\n"; my @rows = $table->rows; chomp @$_ for @rows; my $output = join ' ', 'data:' . $rows[0][0], "$rows[1][0]:" . do { $rows[2][0] =~ /- (...)/; $1 }, "$rows[3][0]:" . substr $rows[2][0], 6, 4; print $output;