crashing on the full moon

[email protected] (Josh Goldberg)
Newsgroups perl.fwp
Message-ID <[email protected]>
A (java programming) coworker presented this challenge while discussing 
a hypothetical situation:

> * Chris troubleshoots and sees that David (in a moment of sheer 
> insanity) coded the site to crash at 5:42pm on every full moon (do I 
> hear a Perl Monger side say there is a Perl library for just such a 
> thing -- and it's only 2 lines?).

So, is there a 2 line or less solution?  Here's an untested four line 
solution straight out of cpan, but I'd love to see what fwp can come up 
with.

use DateTime::Event::Lunar qw(:phases);
$a=DateTime->now();
$d=DateTime::Event::Lunar->lunar_phase_after(phase => 
FULL_MOON,datetime=>$a,on_or_after=>1);
die if $a->dmy eq $d->dmy && $a->hms =~ /^17:42/;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.