fork download
  1. #!/usr/bin/perl
  2. use strict;
  3. use CGI;
  4. use CGI::Ajax;
  5.  
  6. my $cgi = new CGI;
  7. my $pjx = new CGI::Ajax( 'exported_func' => \&perl_func );
  8. print $pjx->build_html( $cgi, \&Show_HTML);
  9.  
  10. sub perl_func {
  11. my $input = shift;
  12.  
  13. my $output = $input . " <-было введено.";
  14. return( $output );
  15. }
  16.  
  17. sub Show_HTML {
  18. my $html = <<EOHTML;
  19.   <HTML>
  20.   <BODY>
  21.   Enter something:
  22.   <input type="text" name="val1" id="val1"
  23.   onkeyup="exported_func( ['val1'], ['resultdiv'] );">
  24.   <br>
  25.   <div id="resultdiv"></div>
  26.   </BODY>
  27.   </HTML>
  28. EOHTML
  29. return $html;
  30. }
Runtime error #stdin #stdout #stderr 0.05s 9000KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Can't locate CGI/Ajax.pm in @INC (you may need to install the CGI::Ajax module) (@INC contains: /etc/perl /usr/local/lib/i386-linux-gnu/perl/5.20.1 /usr/local/share/perl/5.20.1 /usr/lib/i386-linux-gnu/perl5/5.20 /usr/share/perl5 /usr/lib/i386-linux-gnu/perl/5.20 /usr/share/perl/5.20 /usr/local/lib/site_perl .) at prog.pl line 4.
BEGIN failed--compilation aborted at prog.pl line 4.