#! perl -slw
use strict;
use LWP::Simple;
use HTML::TableExtract;
my $te = new HTML::TableExtract;
$te->parse( get( 'http://www.sailwx.info/shiptrack/cruiseships.phtml' ) );
for my $table ( $te->tables ) {
print "\n-----------\n";
for my $row ( $table->rows ) {
local $^W;
print join '|', @$row;
}
}
####
...
-----------
Ship|last reported (UTC)|position|Callsign
BATFR20|2008-Mar-20 2100|N 43░00', E 005░36'|BATFR20
BATFR21|2008-Mar-20 2100|N 41░36', E 008░24'|BATFR21
BATFR22|2008-Mar-20 2100|N 42░54', E 005░54'|BATFR22
...
Carribean Princess|2008-Mar-19 0600|N 19░18', W 065░18'|ZCDG8
Prinsendam|2008-Mar-19 0300|N 27░24', W 040░24'|PBGH
Ships in port or not reporting today:|||
TUSTUMENA|2008-Mar-18 1700|N 60░48', W 147░12'|WNGW
Oosterdam|2008-Mar-18 0800|N 23░00', W 107░48'|PBKH
...
####
...
for my $row ( $table->rows ) {
if( $row->[ 0 ] ne 'Ships in port or not reporting today:' ) {
...