#! /usr/bin/perl -w use strict; use CGI::Ajax; use CGI; my $func = sub { my $input = shift; return "got input: $input " ; }; sub Show_HTML { my $html = < CGI::Ajax Example
Enter Something: 
Enter Something: 
EOT } my $cgi = new CGI(); # create a new CGI object my $pjx = new CGI::Ajax( 'jsfunc' => $func ); # the default encoding for CGI::Ajax is encodeURIComponent; # if this causes problems, you can use escape or your own javascript # function; $pjx->js_encode_function('escape'); print $pjx->build_html($cgi,\&Show_HTML);