in reply to Re: Re: Re: Re: Software Error: Close.pm
in thread Software Error: Close.pm

syntax error at enquiry02.pl line 25, near "$mailer open"

This happened because you said:

$mailer open(\%headers);
when what was needed was:
$mailer->open(\%headers);

open, by itself, is a function defined in the core of perl, used for 'opening' files for reading, writing, etcetera. It wants a file handle, a filename, and possibly a mode, but you gave it a hashref. (And preceded it with $mailer by itself, which is puzzling at best or a syntax error at worst). But $mailer->open() is something else entirely. Because you said my $mailer = new Mail::Mailer;, $mailer is now an object of type Mail::Mailer. The module Mail::Mailer actually defines a routine named open() - same name, seemingly as the core function open() - but if you say $mailer->open(), perl looks at the type of $mailer, sees that it's Mail::Mailer, and uses the open() function defined in that module instead.

You should check out some doc, like:

perldoc perlboot
perldoc perltoot
Look elsewher on this site for tutorials on this subject as well.

Also, your code still has a problem. Specifically,

my $body = ( print $mailer $query->param('Title'), print $mailer $query->param('Name'), print $mailer $query->param('Position'), print $mailer $query->param('School'), print $mailer $query->param('Address'), print $mailer $query->param('Suburb'), print $mailer $query->param('State'), print $mailer $query->param('PCode'), print $mailer $query->param('Email'), print $mailer $query->param('Tel'), print $mailer $query->param('Fax'), print $mailer $query->param('Comments'), ); print $mailer $body;
is wrong. I suggest you go to your command line, issue:
perldoc Mail::Mailer
and read what comes up,

(All code given here is UNTESTED unless otherwise stated.)

--Bob Niederman, http://bob-n.com