in reply to Re: How a HTML radio button on click calls a CGI function?
in thread How a HTML radio button on click calls a CGI function?


Hi
Thanks for the reply.
#!C:\Perl\bin\perl.exe -w 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 = <<EOHTML; <HTML> <BODY> Enter something: <input type="text" name="val1" id="val1" onkeyup="exported_func( ['val1'], ['resultdiv'] );"> <br> <div id="resultdiv"></div> </BODY> </HTML> EOHTML return $html; }

When i want to compile this code , it gives a error "Can't find string terminator "EOHTML" anywhere before EOF at ajay.pl line 19.". Plz suggest why this error comes?

Regd's
Sanjay

Replies are listed 'Best First'.
Re^3: How a HTML radio button on click calls a CGI function?
by Erez (Priest) on Dec 21, 2008 at 07:51 UTC

    You probably have whitespace in front of the EOHTML string terminator. Delete anything (tabs, spaces) before it, or better yet, use the CGI methods to generate the html for you.

    "A core tenant of the greater Perl philosophy is to trust that the developer knows enough to solve the problem" - Jay Shirley, A case for Catalyst.