Click here to get back home

Can't find string terminator "EOM" - beginner question

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Can't find string terminator "EOM" - beginner question humphrey.c.chan 06-29-2005
Posted by humphrey.c.chan on June 29, 2005, 3:34 pm
Please log in for more thread options


Hello,

I am a beginner in Perl programming. Currently, I am using Perl
5.005_03 in my Solaris 8 server.

I am getting the following error message when running my program :

Can't find string terminator "EOM" anywhere before EOF at ./my-prog.pl
line 107.

Here's my program excerpt -->>

:
:
105 open (MAIL, "| /usr/lib/sendmail -oi -t");
106 select(MAIL);
107 print <<EOM;
108 From: sa@bonjour.com
109 To: user1@bonjour.com
110
111 Subject: Alert !! Alert !!
112
113
114 Please check the system
115 at your earliest convenience......
116
117 PS: You know who you arev !!
118
119
120 EOM

Please help me to resolve this.

Thanks much,

Humphrey



Posted by Sisyphus on June 30, 2005, 10:45 am
Please log in for more thread options



> Hello,
>
> I am a beginner in Perl programming. Currently, I am using Perl
> 5.005_03 in my Solaris 8 server.
>
> I am getting the following error message when running my program :
>
> Can't find string terminator "EOM" anywhere before EOF at ./my-prog.pl
> line 107.
>
> Here's my program excerpt -->>
>
> :
> :
> 105 open (MAIL, "| /usr/lib/sendmail -oi -t");
> 106 select(MAIL);
> 107 print <<EOM;
> 108 From: sa@bonjour.com
> 109 To: user1@bonjour.com
> 110
> 111 Subject: Alert !! Alert !!
> 112
> 113
> 114 Please check the system
> 115 at your earliest convenience......
> 116
> 117 PS: You know who you arev !!
> 118
> 119
> 120 EOM
>

Looks to me that there's one or more spaces before EOM on line 120. Change
it so that EOM occurs at the very start of the line and see if that helps.

Cheers,
Rob




Posted by Fabian Pilkowski on June 30, 2005, 9:27 pm
Please log in for more thread options


* Sisyphus schrieb:
>>
>> Can't find string terminator "EOM" anywhere before EOF at ./my-prog.pl
>> line 107.
>>
>> Here's my program excerpt -->>
>>
>> :
>> :
>> 105 open (MAIL, "| /usr/lib/sendmail -oi -t");
>> 106 select(MAIL);
>> 107 print <<EOM;
>> 108 From: sa@bonjour.com
>> 109 To: user1@bonjour.com
>> 110
>> 111 Subject: Alert !! Alert !!

As default here-docs do interpolate the string. That means, here you're
looking for any occurence of $scalars/@arrays/%hashes and replace it by
its current (stringified) value. Please escape that "@"-sign by writing
"sa\@bonjour.com".

Second, the Subject is part of the header. You have to delete line 110
if that "Subject:"-line should set the subject of this mail.

>> 112
>> 113
>> 114 Please check the system
>> 115 at your earliest convenience......
>> 116
>> 117 PS: You know who you arev !!
>> 118
>> 119
>> 120 EOM
>
> Looks to me that there's one or more spaces before EOM on line 120. Change
> it so that EOM occurs at the very start of the line and see if that helps.

And, in front of line 105 you marked with ":" that there are more lines.
Are there more lines after line 120 too? Make sure that there is also a
newline behind "EOM".

regards,
fabian


Similar ThreadsPosted
beginner question on use of Frontier::Client November 15, 2006, 10:52 am
Aprroximate string matching May 4, 2005, 8:41 am
Proposal: String::Format::General December 1, 2006, 11:04 am
Proposal: String::Format::General December 2, 2006, 1:53 pm
Proposal: String::Format::General December 2, 2006, 2:56 pm
Announce: Set::Array, Set::Hash, Set::String - new maintainer January 8, 2005, 10:04 am
Checking the presence of mutlibyte char in a string January 4, 2006, 9:23 pm
reading from Net::Telnet input string problem June 16, 2006, 1:17 pm
Cant find pmtools December 9, 2004, 8:11 pm
What is endian.h? and How can I find it? February 15, 2005, 12:50 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap