Need help with simple code not working on my ISP's server 
Author Message
 Need help with simple code not working on my ISP's server

The following code refuses to work on my ISP's server. I get the error
message:
"Missing right curly or square bracket at  end of line 11" (Line 11 is the
line after the second curly bracket)
Can somebody tell why? TIA.

#!/usr/bin/perl

print "Content-type: text/html\n\n";

while (<DATA>) {
print;

Quote:
}

__END__
1106ADAM1234
1106BERT4567
1106CARL7890


Thu, 01 Jul 2004 01:01:46 GMT  
 Need help with simple code not working on my ISP's server

Quote:

> "Missing right curly or square bracket at  end of line 11" (Line 11 is the
> line after the second curly bracket)

> #!/usr/bin/perl

> print "Content-type: text/html\n\n";

> while (<DATA>) {
> print;
> }

> __END__
> 1106ADAM1234
> 1106BERT4567
> 1106CARL7890

There is nothing wrong with that code.  Presumbably the code you are
actually using is different.

Even in such a short script, you should use warnings and strict to help
catch errors.

--
Jeff



Thu, 01 Jul 2004 01:22:47 GMT  
 Need help with simple code not working on my ISP's server

Quote:

> The following code refuses to work on my ISP's server. I get the error
> message:
> "Missing right curly or square bracket at  end of line 11" (Line 11 is the
> line after the second curly bracket)
> Can somebody tell why? TIA.

     1: #!/usr/bin/perl -w
     2: use strict;
     3:
     4: print "Content-type: text/html\n\n";
     5:
     6: while (<DATA>) {
     7: print;
     8: }
     9:
    10: __END__
    11: 1106ADAM1234
    12: 1106BERT4567
    13: 1106CARL7890

The code you posted works fine for me:

dev/tmp > ./y.pl
Content-type: text/html

1106ADAM1234
1106BERT4567
1106CARL7890

Although I might suggest you explicity use a __DATA__ token instead of
the __END__ token - just to make it clear that it's a data segment to
other people.

Now, why is the error mentioning line 11? That's past the __END__ token.
I assume you edited the code - could you post the original code (or if
it's long then an edited but complete example that exhibits the problem)

P

--
pkent 77 at yahoo dot, er... what's the last bit, oh yes, com
Remove the tea to reply



Thu, 01 Jul 2004 02:52:25 GMT  
 Need help with simple code not working on my ISP's server

I ran the code exactly like you had typed. I still got the following error
message

Missing right curly or square bracket at line 10, at end of line
syntax error at line 10, at EOF

Line 10 is the line with __END__.

Funny thing is the following code (and several other perl codes) runs ok on
the same server:

#!/usr/bin/perl -w
use strict;

print "Content-type: text/html\n\n";

print "1106ADAM1234 1106BERT4567 1106CARL7890";

Here are the urls:
www.ospreynet.org/~rao/prog1.pl
www.ospreynet.org/~rao/prog2.pl

Can't figure out what is wrong !!


Quote:


> > The following code refuses to work on my ISP's server. I get the error
> > message:
> > "Missing right curly or square bracket at  end of line 11" (Line 11 is
the
> > line after the second curly bracket)
> > Can somebody tell why? TIA.

>      1: #!/usr/bin/perl -w
>      2: use strict;
>      3:
>      4: print "Content-type: text/html\n\n";
>      5:
>      6: while (<DATA>) {
>      7: print;
>      8: }
>      9:
>     10: __END__
>     11: 1106ADAM1234
>     12: 1106BERT4567
>     13: 1106CARL7890

> The code you posted works fine for me:

> dev/tmp > ./y.pl
> Content-type: text/html

> 1106ADAM1234
> 1106BERT4567
> 1106CARL7890

> Although I might suggest you explicity use a __DATA__ token instead of
> the __END__ token - just to make it clear that it's a data segment to
> other people.

> Now, why is the error mentioning line 11? That's past the __END__ token.
> I assume you edited the code - could you post the original code (or if
> it's long then an edited but complete example that exhibits the problem)

> P

> --
> pkent 77 at yahoo dot, er... what's the last bit, oh yes, com
> Remove the tea to reply



Thu, 01 Jul 2004 21:40:55 GMT  
 Need help with simple code not working on my ISP's server

Quote:

> I ran the code exactly like you had typed. I still got the following error
> message

> Missing right curly or square bracket at line 10, at end of line
> syntax error at line 10, at EOF

> Line 10 is the line with __END__.

Can you find out what version of perl they're using? A little program
like:

#!/usr/bin/perl -w
use strict;
use Config;
print "Content-type: text/plain\n\n";
print Config::myconfig();

should do.

And also, you are uploading your files correctly, so that the line
breaks are right, the files do not have any garbage or non-printable
chars in them, etc? You're using normal FTP not a web-based upload tool,
right? Or frontpage. That code you quoted still generated no errors on
5.00503 or 5.6.1.

From perldiag:
       Missing right curly or square bracket
           (F) The lexer counted more opening curly or square
           brackets than closing ones.  As a general rule, you'll
           find it's missing near the place you were last
           editing.

P

--
pkent 77 at yahoo dot, er... what's the last bit, oh yes, com
Remove the tea to reply



Fri, 02 Jul 2004 06:23:37 GMT  
 Need help with simple code not working on my ISP's server

Quote:

> The following code refuses to work on my ISP's server. I get the error
> message:
> "Missing right curly or square bracket at  end of line 11" (Line 11 is the
> line after the second curly bracket)
> Can somebody tell why? TIA.

The code you've given us is not the exactly same at that running on
your ISP's server. (Line 11 is manifestly NOT the line after the second
curly bracket. It's line 8.)

Chris



Sat, 03 Jul 2004 13:40:22 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Can't use LWP::Simple on my ISP's Server

2. 'use' not working on ISP's NT server

3. Simple DOS/Win95 originated Perl script not working when loaded in the UNIX Server

4. Simple DOS/Win95 originated Perl script not working when loaded in the UNIX Server

5. Send mail script not working in 2nd server but working in 1st server

6. Send mail script not working in 2nd server but working in 1st server

7. Very Simple Find/Replace Hack Not Working, Need Fresh Eyes

8. Module Installation on ISP's server?

9. Code fragment not working (Help!?!)

10. Need help with simple cgi code

11. Need LWP module, but it's not installed on my server

12. Need Help With Simple Code

 

 
Powered by phpBB® Forum Software