package Test::pjx; use strict; use Apache::Constants qw(:common); use CGI qw(:all); # or any other CGI:: form handler/decoder use CGI::Ajax; use warnings; use diagnostics; $^W=1; local $SIG{__WARN__} = \&Carp::cluck; sub handler { my $r = shift; my $env = $r->subprocess_env; my $cgi = new CGI; my $pjx = new CGI::Ajax( 'exported_func' => \&perl_func ); my $ref_show = \&Show_HTML; my $show = $ref_show->($env); print $pjx->DEBUG(1); print $pjx->JSDEBUG(1); print $pjx->build_html( $cgi, $show); return OK; } sub perl_func { my $input = shift; # do something with $input my $output = $input . " was the input!"; return $output ; } sub Show_HTML { my $env = shift; my $html = < Enter something:
EOHTML return $html; } 1; __END__