#!/usr/bin/perl -w use strict; use MD5; use LWP::Simple; my $url='http://www.mrnick.binary9.net'; my $file='sitechanges.txt'; ## grab the contents my $content=get($url) || die $!; ## grab the MD5 sum from our datafile my $oldmd5=''; if (-f $file) { open(IN,"<$file") || die $!; $oldmd5=; close IN; } ## generate the new MD5 my $newmd5=MD5->hexhash($content); ## same? if ($newmd5 ne $oldmd5) { ## file has change ... do something ## .... (insert your mailing code here) ## then save the new md5 open(OUT,">$file") || die $!; print OUT $newmd5; close OUT; } #### if ($modified = $string) { print "the file is the same"; #### if ($modified eq $string) { print "the file is the same";