I want to call an Perl script in the blur function of my input field. But i dont really know how to do this, and i cant find any working things with google. my code of the h
You appear to have written a command line script, designed to be interacted with by a user running it in a shell. (The use of Getopt is a big clue here).
In order to have it respond to an HTTP request you need to rewrite it so that it will work with a webserver (instead of a shell).
There are several ways to do this. A simple approach would be to use CGI. A modern approach would be to use Plack, possibly in conjunction with a framework.
A basic introduction to using Perl/CGI with Apache is available in the Apache documentation. You should look at a module such as CGI in order to process incoming data and emit HTTP headers correctly.
You can find out more about Plack from the project's homepage, which includes links to a number of frameworks that use it.
That worked for me, call it in the blur event:
function perlExecute(name){
XMLHttp.open("GET", "/cgi-bin/balance.pl?cardnumber="+name, true);
XMLHttp.onreadystatechange = function() {
if (XMLHttp.readyState == 4) {
$("#balance").val(XMLHttp.responseText);
}
}
XMLHttp.send(null);
};