<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>&nbsp;&nbsp;&nbsp; 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>&nbsp;&nbsp;&nbsp; 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 (&amp; 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>&nbsp;&nbsp;&nbsp; package RealDemo;<br>&nbsp;&nbsp;&nbsp; use JSON;<br>&nbsp;&nbsp;&nbsp; sub doTest {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; my ($class, $in) = @_;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ($in =~ /cott/) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return "You can not use 'Scott' in your name";<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return JSON::true;<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; 1;<br>Write your configuration file:<br>&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Demo =&gt; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Class =&gt; 'RealDemo',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Methods =&gt; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; doTest =&gt; { params =&gt; 1 },<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; },<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; },<br>&nbsp;&nbsp;&nbsp; }<br>Load your apache config<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PerlModule Apache::RPC::ExtDirect<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Location /data&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SetHandler modperl<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PerlResponseHandler Apache::RPC::ExtDirect<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/Location&gt;<br>After loading your javascript, you can just call the method.<br>e.g.<br>&nbsp;&nbsp;&nbsp; Demo.doTest('Call the function');<br>but you need a callback to get the results.<br>&nbsp;&nbsp;&nbsp; Demo.doTest('Call the function', function(result) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; alert("We got: " + result);<br>&nbsp;&nbsp;&nbsp; });<br><br>Enjoy.<br><br>Scott<br>-- <br>http://scott.dd.com.au/<br>scottp@dd.com.au<br><br><br></div></body></html>