Did you declare your subroutine in the same scope {i.e. the same file) or did you want to reference it through a subroutine file (i.e. require or use "subroutines.txt";? Also, use CGI::Carp, (use CGI::Carp qw(fatalsToBrowser);) and strict. It will save you at least one headached, guaranteed!
Comment on Re: Web page output for sendmail problem