perlTech has asked for the wisdom of the Perl Monks concerning the following question:

Hi Now I am getting the following erro Can't modify require in scalar assignment at (eval 11) line 2, at EOF my code is as follows
my $smtp = new Mail::Mailer 'smtp', Server => 111.11.1.111; my %headers = ('To' => '$YourEmail', 'From' => '$Email'); my $body = '$Message'; my $mailer = new Mail::Mailer->new($smtp, $YourEmail); $mailer ->open(\%headers); print $mailer $body; $mailer->close();
Thanks

Replies are listed 'Best First'.
Re: Can't modify require in scalar assignment
by dave_the_m (Monsignor) on Mar 09, 2005 at 12:21 UTC
    new Mail::Mailer->new($smtp, $YourEmail)
    You are using both method invocation syntaxes, when you should use either one or the other but not both, eg
    Mail::Mailer->new($smtp, $YourEmail); or new Mail::Mailer $smtp, $YourEmail;

    Dave.

Re: Can't modify require in scalar assignment
by Joost (Canon) on Mar 09, 2005 at 11:57 UTC
Re: Can't modify require in scalar assignment
by lidden (Curate) on Mar 09, 2005 at 11:57 UTC
    Please add <code> tags to your questions. it makes it easier to answer and thus more likely that you get an answer. See Writeup Formatting Tips