in reply to Wrong SQL Syntax?

Looks like you've not tried this SQL within MySQL, it wouldn't work there either. You need to quote text/varchar values:

SELECT userid, login_name, realname FROM profiles WHERE login_name='a@ +b.com';

However, the sensible approach would be to use placeholders as described in the DBI documentation. See also Database Programming from the tutorials section.