Of course, if you're using mutt, you can just put something like this in your .muttrc: set signature="~/signature/sig.pl|" and mutt will call your program to generate the signature whenever you compose an email. That's a little more efficient than having a program run all the time in the background.