in reply to Detecting for HTTP pages code changes
Another option, which has the advantage that it will still work properly if the script is interrupted and restarted, is the storable module. This will allow you to easily save variables as a file and retrieve them later, like a very crude database. It might look something like this:
use storable; my $results = retrieve('results_store'); sub check_site { my $domain = shift; my $current_result = check_domain($domain); my $last_result = $results->{$domain}; if (($last_result == 200 || !$last_result) && $current_result == 400 +) { send_email($domain); } if ($last_result != $current_result) { $results->{$domain} = $current_result; store $results, 'results_store'; } }
$PM = "Perl Monk's";
$MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate Priest";
$nysus = $PM . ' ' . $MCF;
Click here if you love Perl Monks
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Detecting for HTTP pages code changes
by afoken (Chancellor) on Jan 16, 2018 at 21:05 UTC |