So here's what I ended up with...
Code:
#!/usr/bin/perl
use LWP::Simple;
use File::Compare;
use File::Copy;
use MIME::Lite;
$page = get("http://www.iss.net/db_data/xpu/RSNS.php");
$html = $page;
$temp = "/var/spool/iss/test/temp.html";
$archive = "/var/spool/iss/test/archive.html";
$mimelite = "/var/spool/iss/test/mimelite.pl";
#sanitize output
$html =~ m|</h2>(.+?)</TR>|s;
#print "$1\n";
open OUTPUT, ">$temp";
print OUTPUT "$1\n";
close OUTPUT;
if (compare("$temp","$archive") == 1) {
### Create the multipart "container":
$msg = MIME::Lite->new(
To =>'user@myemailaddy',
Subject =>'ISS Sensor Updates',
Type =>'multipart/related'
);
$msg->attach(Type => 'text/html',
Data => "New ISS Sensor updates are available.<br>"
);
$msg->attach(Type =>'text/html',
Path =>'/var/spool/iss/test/archive.html',
Filename =>'archive.html',
Disposition => 'inline'
);
$msg->send();
}
unlink $archive;
move($temp, $archive);