tags:

views:

145

answers:

2

I'm new to Perl as well as Flex. I've just gone through the basic (and exciting) stuff in both of them. I just want to call a Perl subroutine from Flex. Is it possible? If so how?

+2  A: 

There are three ways that a Flex web app can access remote systems:

  1. Through an HTTP Get operation using HTTPService ( http://livedocs.adobe.com/flex/3/html/data_access_2.html )
  2. Through a SOAP Web Service using WebService ( http://livedocs.adobe.com/flex/3/html/data_access_3.html )
  3. Through a RemoteObject call using RemoteObject ( http://livedocs.adobe.com/flex/3/html/data_access_4.html )

For Number 1, just use the URL to a page that executes the Perl code on the server should work fine.
For Number 2, look for info here: http://www.perl.com/pub/a/2001/01/soap.html on creating Web Services with Perl. For number 3, look into this http://www.simonf.com/flap/ for setting up an AMF gateway with Perl.

Number 3 would be my preferred option, however I would suspect that number 1 is going to be easiest to get up and running with.

www.Flextras.com
The OP isn't clear, but it sounds like he wants to call some local Perl code from within Flex, not a remote web application.
friedo
If so; the answer is he can't use Flex to execute local code. Flex is designed to be a front end to a server side technology. He could install Perl on a local server, and access it via Flex in the browser (or AIR) using the methods I describe. It probably isn't practical though.
www.Flextras.com
+4  A: 

Let me say something which you have digest first, i doubt flex and perl community is large enough compared to Flex and Java or PHP.

Flex and perl via XML

http://giantflyingsaucer.com/blog/?p=575

Update:

http://www.simonf.com/flap/code.html

The above link shows on how to communicate Flex with perl function, yet again the docs are not clear and there is no such good example in the google as far as i found.

Perl though was built for even web app, but perl's real usage lies some where. I suggest you to learn PHP or JAVA and then communicate them with Adobe Flex.

Very nice question though!!!

Vinothbabu