Sorry to all of you, but it's not working. Let me clear myself, I wanna write a CGI script, which would do following.
# required modules
# html generation depending upon session info
# begining html code
print $cgi->p("user no" . $session->id);
# remaining html code
# ajax call
my $pjx = new CGI::Ajax( 'exported_func' => \&perl_func);
print $pjx->build_html($cgi, \&htm);
I am finding it difficult to generate HTML content with session info, and forward it to Ajax call
If it wouldn't have been Ajax call, then, manipulating HTML content depending upon session info was easy part for me.