<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: Times New Roman; font-size: 12pt; color: #000000'>Hey Dudes<br><br>For those who use ExtJS 3.0, the new Direct (basically RPC) is excellent, but there was no Perl backend. Now there is:<br><br> http://scott.dd.com.au/wiki/Ext.Direct<br><br>It is pretty basic. There is a simple CGI version and a modperl version.<br><br> http://github.com/scottp/extjs-direct-perl/blob/master/modperl/Apache/RPC/ExtDirect.pm<br><br>I have only spent a few hours on it so far, so there is hardly any testing, a few features missing and no security. Currently it is good as a reference implementation, but I am working on two CPAN releases: RPC::ExtDirect - a perl module useful for calling from CGI. I would also like to use that (directly or as a reference) for a Catalyst module or similar. AND Apache::RPC::ExtDirect which is currently fully working, including preloading of classes (& optional instantiation), but still needs documentation, more testing and better configuraiton before release.<br><br>So a quick how do you use it?<br><br>Write your module<br> package RealDemo;<br> use JSON;<br> sub doTest {<br> my ($class, $in) = @_;<br> if ($in =~ /cott/) {<br> return "You can not use 'Scott' in your name";<br> }<br> return JSON::true;<br> }<br> 1;<br>Write your configuration file:<br> {<br> Demo => {<br> Class => 'RealDemo',<br> Methods => {<br> doTest => { params => 1 },<br> },<br> },<br> }<br>Load your apache config<br> PerlModule Apache::RPC::ExtDirect<br> <Location /data><br> SetHandler modperl<br> PerlResponseHandler Apache::RPC::ExtDirect<br> </Location><br>After loading your javascript, you can just call the method.<br>e.g.<br> Demo.doTest('Call the function');<br>but you need a callback to get the results.<br> Demo.doTest('Call the function', function(result) {<br> alert("We got: " + result);<br> });<br><br>Enjoy.<br><br>Scott<br>-- <br>http://scott.dd.com.au/<br>scottp@dd.com.au<br><br><br></div></body></html>