[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] syntax error



Date: Wed, 29 Nov 2000 12:07:07 +0000 Amitava Basu <incas@vsnl.net> wrote:

>Hello everybody:
>
>I am having a lot of problem trying to fix the program.
>When I run the following program, macperl window shows
>the following error. It is in line #7.
>Can someone please help.
>
>Amitava
>
>========================================================
># Can't find string terminator "EOP" anywhere before EOF.
>File 'LC 2:MacPerl ƒ: formregistration.pl'; Line 7
>========================================================
>
>
> #!/usr/bin/perl -w
> push (@INC,"/usr/localbusiness/http/accn.com/cgi-bin");
> require("cgi-lib.pl");
> print &PrintHeader;
>
> &ReadParse(*regitration-data);
> print<<"EOP";
> <html>
> <head><title>Aztec Registration Form</title>
> </head>
> <body>
> EOP
> if (length($registration-data{"FirstName"})> 0 &&
>length($registration-data{"Last Name"})> 0)
>{
> print<<"EOP";
> Thank you $registration-data{"FirstName"}
>$registration-data{LastName}for registering your
>	name with Aztec. You will now verify
>		the information entered in the form.
>     		Please Correct if necessary</h3>
> EOP
> $Registration_Type="Confirm Registration Data"
> print "<ul>";
> foreach $var(keys(%registration-data))
>    {
>     if (length($registration-data{"$var"})==0)
>    {
>   print"<li>Your<em>$var</em>will be used to help confirm your order
>          Please fill in the <em>$var</em>field";
>     }
>  }
> print "</ul>";
> }
> else
>    {        $Registration_Type="Submit Registration"}
>        if (defined($registration-data{"Phone Number"}))
>           {$PhoneNumber=$registration-data{"Phone Number"};
>
>}
>  else
>             {$PhoneNumber="(999) 999-999";
>}
> print <<"TEST";
> <hr noshade>
> <center>
> <Form Method=POST Action="/cgibook/regs.cgi">
> <input type=hidden name=SavedName
>value="registration-data{'First Name'}$registration-data
>{'Last Name'}">
> <table border=0 width=60%>
> caption align = top><h3>Aztec Registration
>Form</h3></caption>
> <th ALIGN LEFT>First Name
> <th ALIGN LEFT colspan=2>Last Name<tr>
> <td>
> <input type=text size=32 maxlength=20
> name="First Name" value=Registration data{"First Name"}>
> <td colspan=2>
> <input type=text size=32 maxlength=40
> name="Last Name" value=$registration-data{"Last Name"}
>><tr>
> <th ALIGN=LEFT colspan=3>
> Street Address <td><td><tr>
> <td colspan=3>
> <input type=text size=61 maxsize=61
> name"Street" value:$registration-data {'Street'}"><tr>
> <th ALIGN LEFT>City
> <th ALIGN LEFT>State
> <th ALIGH LEFT>Zip <tr>
> <td><input type =text sixe=20 maxlength=30
> name=="City" value="$registration-data{'City'}">
> <td><input type =text sixe=20 maxlength=20
> name=="State" value="$registration-data{'State'}">
> <td><input type =text size=5 maxlength=10
> name=="Zip" value="$registration-data{'Zip'}"><tr>
> <th ALIGN=LEFT  colspan=1>Phone Number
> <th ALIGN=LEFT  colspan=2>E-Mail Address<tr>
> <td colspan=1><input type=test size=15 maxlength=15
> name="Phone Number" value="$PhoneNumber">
> <td colspan=2><input type=test size=32 maxlength=32
> name="E-Mail Address" value={"$EmailAddress"} ><tr>
> <td width=50%><input type="submit" name="simple"
>value=$Registration-Type>
> <td width=50%><input type="reset"><tr>
> </table>
> </FORM>
> </center>
> <hr noshade>
> </body>
> </html>
> TEST
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
------------------

Amitava:

As Ronald J Kimball <rjk@linguist.dartmouth.edu> replied before:

Remove the whitespace before or after your closing tag if they have been
included
(you can not indent the end tags EOP and the end tag TEST or add
whitespaces after them)


Reference:

http://bumppo.net/lists/macperl/2000/11/msg00170.html

Re: [MacPerl] syntax error
------------------------------------------------------------------------

*	To: Amitava Basu <incas@vsnl.net>
*	Subject: Re: [MacPerl] syntax error
*	From: Ronald J Kimball <rjk@linguist.dartmouth.edu>
*	Date: Wed, 29 Nov 2000 09:34:17 -0500
*	Cc: MacPerl Mailing List <macperl@macperl.org>
*	Delivered-To: irons-bumppo:net-mpmacperl@bumppo.net
*	In-Reply-To: <3A24F16B.253FA2E8@vsnl.net>; from Amitava Basu on
Wed, Nov 29,              	2000 at 12:07:07PM +0000
*	References: <3A24F16B.253FA2E8@vsnl.net>
------------------------------------------------------------------------

On Wed, Nov 29, 2000 at 12:07:07PM +0000, Amitava Basu wrote:
> Hello everybody:
>
> I am having a lot of problem trying to fix the program.
> When I run the following program, macperl window shows
> the following error. It is in line #7.
> Can someone please help.
>
> Amitava
>
> ========================================================
> # Can't find string terminator "EOP" anywhere before EOF.
> File 'LC 2:MacPerl Ÿ: formregistration.pl'; Line 7
> ========================================================
>

>  print<<"EOP";

Your here-doc terminator is the string "EOP"...

>  <html>
>  <head><title>Aztec Registration Form</title>
>  </head>
>  <body>
>  EOP

...but down here you use " EOP".


perldiag:

       Can't find string terminator %s anywhere before EOF

           (F) Perl strings can stretch over multiple lines.
           This message means that the closing delimiter was
           omitted.  Because bracketed quotes count nesting
           levels, the following is missing its final
           parenthesis:

               print q(The character '(' starts a side comment.);

           If you're getting this error from a here-document, you
           may have included unseen whitespace before or after
           your closing tag. A good programmer's editor will have
           a way to help you find these characters.


You need to make sure you use exactly the same string at the end of the
here-doc that you use at the beginning.

Ronald
------------------------------------------------------------------------



HTH

David in Maine



# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org