Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dont understand this error

Status
Not open for further replies.

MayFlowerNew

Programmer
Dec 21, 2004
20
CH
HI all,

I have written following code..

/usr/lib/sendmail -oi -t <<EOF
To: abc@xyz.com
Subject: test
test
EOF

But I get this error..

Bareword found where operator expected at aaa.pl line 127, near "/usr/lib"
(Missing operator before lib?)
syntax error at aaa.pl line 127, near "/usr/lib"
In string, @xyz now must be written as \@xyz at aaa.pl line 127, near "To: abc@xyz"

I am a newbie, please help

Thanks
 
Should be this:

Code:
open(MAIL, '/usr/lib/sendmail -oi -t');
print MAIL <<EOF
To: abc@xyz.com
Subject: test
test
EOF

- Rieekan
 
It says Syntax error near print.

Also Could you please explain why we have to open sendmail?
 
change this line:

open(MAIL, '/usr/lib/sendmail -oi -t');

to:

open(MAIL, "|/usr/lib/sendmail -oi -t");

and see if that helps.
 
missing ";" after <<EOF

also need a "." on last line by itself.

Code:
open(MAIL, '| /usr/lib/sendmail -oi -t');
print MAIL <<EOF;
To: abc@xyz.com
Subject: test
test
.
EOF


Michael Libeson
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top