robert@0: #!C:/strawberry/perl/bin/perl.exe robert@0: robert@0: # this is an example script of how you would use coderefs to define robert@0: # your CGI::Ajax functions, and the methods return multiple results to robert@0: # the page robert@0: # robert@0: # NB The CGI::Ajax object must come AFTER the coderefs are declared. robert@0: robert@0: use strict; robert@0: use CGI::Ajax; robert@0: use CGI; robert@0: robert@0: my $q = new CGI; robert@0: robert@0: my $multiply = sub { robert@0: my $a = shift; robert@0: my $b = shift; robert@0: return $a * $b; robert@0: }; robert@0: robert@0: my $divide = sub { robert@0: my $a = shift; robert@0: my $b = shift; robert@0: return $a / $b; robert@0: }; robert@0: my $G = 'asdf'; robert@0: my $Show_Form = sub { robert@0: my $html = ""; robert@0: $html .= qq! robert@0: robert@0: