in reply to checking for null variables

This is completely unrelated to your primary problem, which people have apparently already helped you with. You might want to consider improving the style of your code. Firstly, there's no need to have those newlines in their own print statements -- instead you might try:
print MESSAGE "Full Name: $FORM{name}\n";
Secondly, you might want to bunch all those prints together into a single big print with a here document. It might look like this:
print MESSAGE <<EOMSG; To: $FORM{submitaddress} From: $FORM{name} Reply-To: $FORM{email} Subject: Faculty Bibliography Submission The following information was submitted from $FORM{name} at $FORM{emai +l}: Full Name: $FORM{name} Publication Name: $FORM{pubname} Other Authors: $FORM{otherauthors} Other Editors: $FORM{othereditors} Main Publication Title: $FORM{pubtitle} EOMSG
Finally, an alternative might be to make the generation of the form even more dynamic:
$longform{name} = "Full Name"; $longform{pubname} = "Publication Name"; ... foreach my $form (keys %longform) { print MESSAGE "$form: $longform{$form}\n"; } ...
The downside to the last idea, of course, is that you lose control over the ordering. Hopefully these ideas will be useful...

Replies are listed 'Best First'.
Re: Re: checking for null variables
by dragonchild (Archbishop) on Apr 15, 2003 at 19:59 UTC
    The downside to the last idea, of course, is that you lose control over the ordering.

    Unless, of course, you keep your ordering in some @ordering array. Then, your loop looks something like:

    my %longform ... $longform{name} = 'Full Name'; $longform{pubname} = 'Publication Name'; ... my @ordering = qw( name pubname ... ); foreach my $form (@ordering) { print MESSAGE "$form: $longform{$form}\n"; } ...
    (Style nit - don't use double-quotes unless you need them. Single-quotes tell me, the maintainer, that this is a constant string. Double-quotes tell me it could change.)

    ------
    We are the carpenters and bricklayers of the Information Age.

    Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.

    Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.