Can"t find string terminator "EOHTML" anywhere before EOF

Can"t find string terminator "EOHTML" anywhere before EOF

am 04.04.2008 16:20:17 von Pau Marc Munoz Torres

------=_Part_7269_4882731.1207318817528
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Hi

I just copied this script from CGI::Ajax manual at cpan.org page

use strict;
use CGI; # or any other CGI:: form handler/decoder
use CGI::Ajax;

my $cgi =3D new CGI;
my $pjx =3D new CGI::Ajax( 'exported_func' =3D> \&perl_func );

print $pjx->build_html( $cgi, \&Show_HTML);

sub perl_func {
my $input =3D shift;
# do something with $input
my $output =3D $input . " was the input!";
return( $output );
}

sub Show_HTML {
my $html =3D <

Enter something:
onkeyup=3D"exported_func( ['val1'], ['resultdiv'] );">





EOHTML
return $html;
}

And I get the error:

Can't find string terminator "EOHTML" anywhere before EOF at ./ajax.pl line
37.

What's wrong?

--=20
Pau Marc Mu=F1oz Torres

Laboratori de Biologia Computacional
Institut de Biotecnologia i Biomedicina Vicent
Villar
Universitat Autonoma de Barcelona
E-08193 Bellaterra (Barcelona)

tel=E8fon: 93 5812807
Email : paumarc.munoz@bioinf.uab.cat

------=_Part_7269_4882731.1207318817528--

Re: Can"t find string terminator "EOHTML" anywhere before EOF

am 04.04.2008 16:39:24 von Jenda Krynicky

From: "Pau Marc Munoz Torres"
> I just copied this script from CGI::Ajax manual at cpan.org page
>
> use strict;
> use CGI; # or any other CGI:: form handler/decoder
> use CGI::Ajax;
>
> my $cgi = new CGI;
> my $pjx = new CGI::Ajax( 'exported_func' => \&perl_func );
>
> print $pjx->build_html( $cgi, \&Show_HTML);
>
> sub perl_func {
> my $input = shift;
> # do something with $input
> my $output = $input . " was the input!";
> return( $output );
> }
>
> sub Show_HTML {
> my $html = < >
>
> Enter something:
> > onkeyup="exported_func( ['val1'], ['resultdiv'] );">
>

>


>
>
> EOHTML

Most likely you have some whitespace before or after the EOHTML.
Remove it.

Jenda
===== Jenda@Krynicky.cz === http://Jenda.Krynicky.cz =====
When it comes to wine, women and song, wizards are allowed
to get drunk and croon as much as they like.
-- Terry Pratchett in Sourcery


--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/

Re: Can"t find string terminator "EOHTML" anywhere before EOF

am 04.04.2008 16:40:34 von Rob Dixon

Pau Marc Munoz Torres wrote:
> Hi
>
> I just copied this script from CGI::Ajax manual at cpan.org page
>
> use strict;
> use CGI; # or any other CGI:: form handler/decoder
> use CGI::Ajax;
>
> my $cgi = new CGI;
> my $pjx = new CGI::Ajax( 'exported_func' => \&perl_func );
>
> print $pjx->build_html( $cgi, \&Show_HTML);
>
> sub perl_func {
> my $input = shift;
> # do something with $input
> my $output = $input . " was the input!";
> return( $output );
> }
>
> sub Show_HTML {
> my $html = < >
>
> Enter something:
> > onkeyup="exported_func( ['val1'], ['resultdiv'] );">
>

>


>
>
> EOHTML
> return $html;
> }
>
> And I get the error:
>
> Can't find string terminator "EOHTML" anywhere before EOF at ./ajax.pl line
> 37.
>
> What's wrong?

The here-document terminator EOHTML must be on its own on the line, i.e.
there can't be any whitespace before or after it or it won't be found.

Rob

--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/

Re: Can"t find string terminator "EOHTML" anywhere before EOF

am 04.04.2008 16:51:02 von Pau Marc Munoz Torres

------=_Part_7424_17392579.1207320662867
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

mmmmmmm

i did in a single line and i keep havinh the problem

my $html =3D <Enter something: name=3D"val1" id=3D"val1"onkeyup=3D"exported_func( ['val1'], ['resultdiv']
);">

EOHTML

return $html;



2008/4/4, Rob Dixon :
>
> Pau Marc Munoz Torres wrote:
> > Hi
> >
> > I just copied this script from CGI::Ajax manual at cpan.org page
> >
> > use strict;
> > use CGI; # or any other CGI:: form handler/decoder
> > use CGI::Ajax;
> >
> > my $cgi =3D new CGI;
> > my $pjx =3D new CGI::Ajax( 'exported_func' =3D> \&perl_func );
> >
> > print $pjx->build_html( $cgi, \&Show_HTML);
> >
> > sub perl_func {
> > my $input =3D shift;
> > # do something with $input
> > my $output =3D $input . " was the input!";
> > return( $output );
> > }
> >
> > sub Show_HTML {
> > my $html =3D < > >
> >
> > Enter something:
> > > > onkeyup=3D"exported_func( ['val1'], ['resultdiv'] );">
> >

> >

> >
> >
> > EOHTML
> > return $html;
> > }
> >
> > And I get the error:
> >
> > Can't find string terminator "EOHTML" anywhere before EOF at ./ajax.pl
> line
> > 37.
> >
> > What's wrong?
>
>
> The here-document terminator EOHTML must be on its own on the line, i.e.
> there can't be any whitespace before or after it or it won't be found.
>
>
> Rob
>
>
> --
> To unsubscribe, e-mail: beginners-unsubscribe@perl.org
> For additional commands, e-mail: beginners-help@perl.org
> http://learn.perl.org/
>
>
>


--=20
Pau Marc Mu=F1oz Torres

Laboratori de Biologia Computacional
Institut de Biotecnologia i Biomedicina Vicent
Villar
Universitat Autonoma de Barcelona
E-08193 Bellaterra (Barcelona)

tel=E8fon: 93 5812807
Email : paumarc.munoz@bioinf.uab.cat

------=_Part_7424_17392579.1207320662867--

Re: Can"t find string terminator "EOHTML" anywhere before EOF

am 04.04.2008 16:54:48 von Rob Dixon

Pau Marc Munoz Torres wrote:
> mmmmmmm
>
> i did in a single line and i keep havinh the problem
>
> my $html = <Enter something: > name="val1" id="val1"onkeyup="exported_func( ['val1'], ['resultdiv']
> );">

EOHTML
>
> return $html;

You misunderstand me. EOHTML must appear in a line on its own, with no
whitespace before or after it on that line.

Rob

--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/