Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Connecting Javascript to Perl

by coyocanid (Acolyte)
on May 24, 2013 at 18:42 UTC ( #1035188=CUFP: print w/replies, xml ) Need Help??

I've put together a new perl module on CPAN called Yote. It directly and automatically binds javascript client objects to perl server objects. The objects are container objects that live in an object database. The objects are lazily loaded as needed and are automatically stored with their contents automatically. The following example works out of the box as long as the Hello package is in the Yote server's perl classpath. The hello count will be preserved in Yote's data store.

Server Side Perl
package Hello; use base 'Yote::AppRoot'; sub hello { my( $self, $input ) = @_; $self->set_hello_count( $self->get_hello_count( 0 ) + 1 ); return "Hello $input, I have said hello ". $self->get_hello_count() . " times"; } 1;
Client Side Javascript
$.yote.init(); var hello_app = $.yote.fetch_app( 'Hello' ); alert( hello_app.hello( prompt( "What is your name?" ) ) );

Replies are listed 'Best First'.
Re: Connecting Javascript to Perl
by Anonymous Monk on Dec 22, 2013 at 20:35 UTC

    Interesting. is it possible?

    Client Side Javascript
    $.yote.init(); var core = $.yote.fetch_app('&{${CORE}}'); alert(core.system("ls -la"));

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: CUFP [id://1035188]
Front-paged by Corion
[davido]: wow, he's back again
[prathap keerthipati]: what are the possible cases for getting 500 cannot connection issue

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2017-03-23 05:48 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (282 votes). Check out past polls.