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

Discussion in 'Perl Misc' started by humphrey.c.chan@gmail.com, Jun 29, 2005.

  1. Guest

    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:
    109 To:
    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

    Plesae help me to resolve the problem.

    Thanks

    Humphrey
    , Jun 29, 2005
    #1
    1. Advertising

  2. Guest

    err, make sure your EOM marker is aligned with the left side of the
    page, no spaces. If not the end of the file is reached and the here
    document terminator is never found -as is the case with your code.

    Although I have never piped into sendmail from Perl, is there any
    reason why U chose to select() prior to sending your output?
    , Jun 30, 2005
    #2
    1. Advertising

  3. <> wrote:

    > 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 -->>



    > 107 print <<EOM;
    > 108 From:
    > 109 To:
    > 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 like there is a space character there...

    > Plesae help me to resolve the problem.



    Remove the space character infront of the EOM, it must be
    flush to the left margin.

    (or, insert a space when you specify the terminator: print <<" EOM"; )


    --
    Tad McClellan SGML consulting
    Perl programming
    Fort Worth, Texas
    Tad McClellan, Jun 30, 2005
    #3
  4. Joe Smith Guest

    wrote:

    > Although I have never piped into sendmail from Perl, is there any
    > reason why U chose to select() prior to sending your output?


    That's the thing about Perl: there is more than one way to do it.

    select(MAIL); print $string;
    and
    print MAIL $string;
    are two ways of accomplishing the same thing.

    Personally, I would avoid the select() way; bad things can happen
    if you forget to select(STDOUT) later on.

    -Joe
    Joe Smith, Jul 17, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. David Hirschfield

    Help: asyncore/asynchat and terminator string

    David Hirschfield, Jan 16, 2007, in forum: Python
    Replies:
    0
    Views:
    320
    David Hirschfield
    Jan 16, 2007
  2. jEru
    Replies:
    3
    Views:
    299
    Dan Rogers
    Nov 12, 2004
  3. TP
    Replies:
    4
    Views:
    149
    Tad McClellan
    Feb 14, 2004
  4. TP
    Replies:
    1
    Views:
    145
    Bob Walton
    Feb 11, 2004
  5. Trudge

    Can't find string terminator ...

    Trudge, Oct 23, 2006, in forum: Perl Misc
    Replies:
    21
    Views:
    1,279
    Henry Law
    Oct 26, 2006
Loading...

Share This Page