Click to See Complete Forum and Search --> : Perl


Winglys
03-18-2003, 08:53 AM
why this code won't work?

for($j=0;$j<6;$j++)
{
open (MESSAGE,"| /usr/lib/sendmail -t");
print MESSAGE "To: $FORM{email[$j]}\n";
}

is this part got problem?

$form{email[$j]}

jeffmott
03-18-2003, 10:18 AM
You must prefix all scalar values (even those obtained through an array) with a $.

$FORM{$email[$j]}

DaiWelsh
03-19-2003, 10:10 AM
Hmm, you dont say what you are trying to do, but looking at your code I think perhaps you do not have an array called email as Jeff has understandably assumed?

I am guessing you are passing several fields from your form each of which holds an email address? If so, it would be good to see the section of the form with these fields in to understand how they are named.

Dai