#!/usr/bin/perl # upblue.pl -- update full moons that are blue # (c) Copyright 2004-2008, Douglas W. Clifton, all rights reserved. # for more copyright information visit the following URI: # http://loadaveragezero.com/info/copyright.php use DBI; require 'mysql.pl'; $ds = "DBI:mysql:database=$my{DB};host=$my{host}"; $db = DBI->connect($ds, $my{usr}, $my{pwd}); $up = 'update moon_phases set phase=\'blue\' where date=?'; $sh = $db->prepare($up) or die $db->errstr; while () { chomp; $n++ if $sh->execute($_); } $sh->finish; $db->disconnect; print 'updated ', $n, ' moon phase records.', "\n"; __DATA__ 1970-05-21 1972-11-20 1975-08-21 1978-05-22 1981-02-18 1983-08-23 1986-08-19 1989-05-20 1991-11-21 1994-08-21 1997-05-22 2000-02-19 2002-08-22 2005-08-19 2008-05-20 2010-11-21 2013-08-21 2016-05-21 2019-05-18 2021-08-22 2024-08-19 2027-05-20 2029-08-24 2032-08-21 2035-05-22