in reply to NT and Email

Really simple. Here's the error message:
String found where operator expected at mailtestorg.pl line 9, near "here 'JoeCoolio'" (Do you need to predeclare here?)
'here' in that context is supposed to be part of the comment, but Perl's not picking it up as part of the comment. That's probably because there's a newline right before it.

Make sure that there are no newlines in your comments, and I'm confident that this error will disappear.

If you're really having trouble understanding Perl warnings and errors, put 'use diagnostics;' at the start of your script, near 'use strict;'. It'll save you looking things up in perldiag yourself.