Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

how to fix this perl error

Name: Anonymous 2013-05-28 16:54

Backslash found where operator expected at ./mail.pl line 26, near "print "\"
  (Might be a runaway multi-line "" string starting on line 22)
    (Do you need to predeclare print?)
Backslash found where operator expected at ./mail.pl line 26, near "n\"
Backslash found where operator expected at ./mail.pl line 26, near "n\"
String found where operator expected at ./mail.pl line 26, at end of line
    (Missing semicolon on previous line?)
syntax error at ./mail.pl line 26, near "print "\"
Can't find string terminator '"' anywhere before EOF at ./mail.pl line 26.


#!/usr/bin/perl

print "\n\tTo……..: ";
chomp ($to = <>);
print "\tFrom……: ";
chomp ($from = <>);
print "\tReply To..: ";
chomp ($reply = <>);
print "\tSubject…: ";
chomp ($subject = <>);
print "\n\tMessage…: ";
chomp ($message = <>);
print "\n\tNumber of Messages: ";
chomp ($msgnum = <>);

for ($x = 0; $x < $msgnum; $x++) {
open(MAIL, "|/usr/sbin/sendmail -t");
print MAIL "To: $to\n";
print MAIL "From: $from\n";
print MAIL "Reply-To: $reply\n";
print MAIL "Subject: $subject\n\n";
print MAIL "$message\n\n\n\n\n\n\n\\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\";
close(MAIL);
}

print "\n\t$msgnum messages sent to $to.\n\n";
exit(0);

Name: Anonymous 2013-05-28 17:01


#!/usr/bin/perl

 print "\n\tTo……..: ";
 chomp ($to = <>);
 print "\tFrom……: ";
 chomp ($from = <>);
 print "\tReply To..: ";
 chomp ($reply = <>);
 print "\tSubject…: ";
 chomp ($subject = <>);
 print "\n\tMessage…: ";
 chomp ($message = <>);
 print "\n\tNumber of Messages: ";
 chomp ($msgnum = <>);

 for ($x = 0; $x < $msgnum; $x++) {
 open(MAIL, "|/usr/sbin/sendmail -t");
 print MAIL "To: $to\n";
 print MAIL "From: $from\n";
 print MAIL "Reply-To: $reply\n";
 print MAIL "Subject: $subject\n\n";
 print MAIL "$message\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n";
 close(MAIL);
 }

 print "\n\t$msgnum messages sent to $to.\n\n";
 exit(0);


You had extra \'s in this line

print MAIL "$message\n\n\n\n\n\n\n\\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\";

Name: Anonymous 2013-05-28 17:36

Hi guys, how do I read an error message?

Name: Anonymous 2013-05-29 1:52

>>2
It still doesn't work. Same error message.

Name: Anonymous 2013-05-29 2:37

>>4
That's bullshit, I just ran it and it works fine.

Don't change these.
Name: Email:
Entire Thread Thread List