• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 681
  • Last Modified:

Can't find string terminator "\nEND" anywhere before EOF : (6 lines script)

why the bellow script is giving me error  as

 Can't find string terminator "\nEND" anywhere before EOF  at /cgi-perl/mason.pl line 6.\n


#!/usr/bin/perl
  
  use strict;
  use HTML::Mason;
  my $interp = HTML::Mason::Interp->new( );
  my $comp = $interp->make_component(comp_source => <<'END');
   Greetings, <% ("Earthlings", "Martians")[rand 2] %>
  END
  $interp->exec($comp);

Open in new window

0
fosiul01
Asked:
fosiul01
  • 2
  • 2
1 Solution
 
kawasCommented:
END needs to be on a line without any spaces ...
#!/usr/bin/perl
  
  use strict;
  use HTML::Mason;
  my $interp = HTML::Mason::Interp->new( );
  my $comp = $interp->make_component(comp_source => <<'END');
   Greetings, <% ("Earthlings", "Martians")[rand 2] %>
END
  $interp->exec($comp);

Open in new window

0
 
fosiul01Author Commented:
thanks
its seems allright

but do you have any idea why its giving me this error

 [Tue Mar 30 15:02:13 2010] [error] [client xx.xx.xx.xx] malformed header from script. Bad header=   Greetings, Earthlings: mason.pl
[Tue Mar 30 15:02:13 2010] [warn] /cgi-perl/mason.pl did not send an HTTP header

i thought massion handle all html by it self.
0
 
kawasCommented:
i dont know anything about Mason ... but you probably need to

print "Content-type: text/html", "\n\n";
0
 
fosiul01Author Commented:
yum you are damm right

that allow to print..


thanks

can you please look into this question please... its seems , in EE , not too many ppl visit perl zone!!!

http://www.experts-exchange.com/Programming/Languages/Scripting/Perl/Q_25603055.html
0

Featured Post

2018 Annual Membership Survey

Here at Experts Exchange, we strive to give members the best experience. Help us improve the site by taking this survey today! (Bonus: Be entered to win a great tech prize for participating!)

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now