bryanbayfield
Technical User
Following on from a previous thread thread219-565848 , I've been asked to post this problem in a new thread.
Here is my program (it's not very complicated, is it?!
and here are the errors it generates:
[tt]Software error:
Global symbol "$from" requires explicit package name at smail.pl line 7.
Global symbol "@hotmail" requires explicit package name at smail.pl line 7.
Global symbol "$to" requires explicit package name at smail.pl line 8.
Global symbol "$subject" requires explicit package name at smail.pl line 9.
Global symbol "$sendmailpath" requires explicit package name at smail.pl line 10.
Global symbol "$sendmailpath" requires explicit package name at smail.pl line 12.
Global symbol "$subject" requires explicit package name at smail.pl line 13.
Global symbol "$from" requires explicit package name at smail.pl line 14.
Global symbol "$to" requires explicit package name at smail.pl line 15.
Execution of smail.pl aborted due to compilation errors.
For help, please send mail to the webmaster (bryanbayfield@spamcop.net), giving this error message and the time and date of the error.[/tt]
I haven't used Perl that much before - I'm really hoping can help me sort this, 'cos it's a bit of a pain!
Thanks in advance.
Here is my program (it's not very complicated, is it?!
Code:
#!/usr/bin/perl -w
use CGI qw(:standard);
use CGI::Carp qw(fatalsToBrowser);
use strict;
$from="[i]accountname[/i]@hotmail.com";
$to="[i]accountname[/i]\@[i]ISP[/i].co.uk";
$subject="I\'m sending myself a test e-mail!";
$sendmailpath="/usr/sbin/sendmail";
open (SENDMAIL, "| $sendmailpath -t");
print SENDMAIL "Subject: $subject\n";
print SENDMAIL "From: $from\n";
print SENDMAIL "To: $to\n\n";
print SENDMAIL "This is a test e-mail.\n\n";
print SENDMAIL "I like to make lists:\n";
print SENDMAIL "- One\n";
print SENDMAIL "- Two\n";
print SENDMAIL "- Three\n\n";
print SENDMAIL "Bye!\n\n";
close (SENDMAIL);
and here are the errors it generates:
[tt]Software error:
Global symbol "$from" requires explicit package name at smail.pl line 7.
Global symbol "@hotmail" requires explicit package name at smail.pl line 7.
Global symbol "$to" requires explicit package name at smail.pl line 8.
Global symbol "$subject" requires explicit package name at smail.pl line 9.
Global symbol "$sendmailpath" requires explicit package name at smail.pl line 10.
Global symbol "$sendmailpath" requires explicit package name at smail.pl line 12.
Global symbol "$subject" requires explicit package name at smail.pl line 13.
Global symbol "$from" requires explicit package name at smail.pl line 14.
Global symbol "$to" requires explicit package name at smail.pl line 15.
Execution of smail.pl aborted due to compilation errors.
For help, please send mail to the webmaster (bryanbayfield@spamcop.net), giving this error message and the time and date of the error.[/tt]
I haven't used Perl that much before - I'm really hoping can help me sort this, 'cos it's a bit of a pain!
Thanks in advance.