Example of AMF::Perl in action

## This is an example of AMF::Perl in action. Download Flash 6 player from here if you don't have it. It even works on Linux! This shows various data types passed through AMF to the perl backend and sent back. The most interesting this is not so much what it does, but how it works. The Perl script utilizes the "service discovery" approach - you simply put Perl modules into a certain directory, and they are automatically registered as services. This example also shows how to throw exceptions, handled by functionName_onStatus in the Flash client (as opposed to functionName_onResult, which is called normally). Simply include in your Perl code
    use AMF::Perl qw/amf_throw/;
and then call amf_throw() with a string or an arbitrary object as a parameter. If you call die "Error message", it will be also caught in the same way and sent as an error to Flash. This is the server-side Perl script basic.pl. This is a sample service DataEcho.pm. |