The above will get you there. However, if you really want to understand the intracacies of Daemonizing in Perl I would recomend reading Network Programming with Perl by Lincoln D. Stein. It's amazing, and available online!
"Nothing is sure but death and taxes" I say combine the two and its death to all taxes!