I wrote my first answer to Life, the Universe, and Everything(?) probably about five years ago. In my opinion, although some may disagree, it's easier to do this then to write a Perl module. Some modules are often updating, whereas The Answer has never changed since Douglas Adams's initial discovery and included it in the Hitchhiker's Guide.
Update: Fixed the name and the E2 link.
Love is random; fear is inevitable. -- Orson Scott Card PerlMonks is good for Perl, but
JavaJunkies is good for Java