I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2007-03-13 10:26:46-07 by nrodriguez
External script

Hello all. I'm developing an applications that uses an external perl script where is the subrutine that must be executed when the javascript event is launched. The issue is that I don't know what I'm doing wrong, but when the event run, the web page return an "internal server error".

I'm following the steps shown in the cpan documentation:

I think the error is in the first script (I resume it here):

#!/usr/bin/perl use strict; use CGI; use CGI::Ajax; my $cgi = new CGI; my $pjx = new CGI::Ajax( 'sumar' => 'Ajax.pl'); print $pjx->build_html( $cgi, \&mostrar_formulario); sub mostrar_formulario { my $html = <<EOHTML; <HTML> <BODY> Fill in the cells with numbers and they will be added <table> <tr><td><input type="text" name="pwd" id="pwd1" onKeyUp="sumar(['pwd1', 'pwd2'], ['resultado'] );"> +</td></tr> <tr><td><input type="text" name="pwd" id="pwd2" onKeyUp="sumar(['pwd1', 'pwd2'], ['resultado'] );"> +</td></tr> <tr><td><input type="text" name="pwd" id="pwd3" onKeyUp="sumar(['pwd1', 'pwd2'], ['resultado'] );"> +</td></tr> </table> <div id="resultado"></div> </BODY> </HTML> EOHTML return $html; }

This little example works fine if all the subrutines are in the same perl script.

The script Ajax.pl exists (with execution privileges) and it has the subrutine 'sumar'. By now, it does nothing, in order to determine where is the error.

Could anyone help me? The documentation in the www shows the same examples in all sites.

Thanks.

Direct Responses: Write a response