G'day Milti,
There's a number of issues with what you've posted:
-
"nothing has worked" and "All without success." provide us with no information about how things didn't work or in what way they were unsuccessful.
The guidelines in "How do I post a question effectively?" will help you in this regard.
-
Your apparent reliance on package variables could be a problem: you don't provide sufficient code to tell.
I recommend you use the strict pragma and fix any problems it reports: in most cases, this will simply require declaring variables with my.
-
If you're not already doing it, I also recommend you use the warnings pragma: this may highlight problems that aren't immediately obvious.
-
You don't show any declarations or assignments for $VAR or $FORM{recipient}.
While testing, you can simply use print to check these have values and what those values are.
-
Consider all data supplied by outside sources to be untrustworthy ("perlsec - Perl security" has a lot more information on this).
You should validate the email addresses supplied by users: Regexp::Common::Email::Address may help with this.
-
A common problem with email addresses is the '@' sign.
This can make a string appear to have an embedded array.
You can use quotemeta to escape the '@', and any other special characters, in the email addresses.