Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer


by coyocanid (Sexton)
on May 24, 2013 at 16:31 UTC ( #1035171=user: print w/replies, xml ) Need Help??

I am a Perl Tinker in the Bay Area. I love writing code and creating stuff with it. I like tricky perl riddles though I'm not very good at them. I support Open Source because it changes the world; the heart of the internet beats because of it. Big Companies come and go, but the spirit of our technology lives on. I have one project of note : Yote, which currently lives at

Posts by coyocanid
seek harsh critique in Seekers of Perl Wisdom
3 direct replies — Read more / Contribute
by coyocanid
on Dec 08, 2017 at 11:00

    I've been working on a project for some years and want to release it to CPAN and I'm not yet happy with the POD I've written.

    I'm looking for a harsh critique of the POD below. I want to make sure it communicates the purpose and use of the module. Critique of the module is also welcome.

multi process advice in Seekers of Perl Wisdom
No replies — Read more | Post response
by coyocanid
on Jun 09, 2013 at 02:50
    Dear Perl Monks,

    I come soliciting opinions, for I have a design decision to make for my Yote project. This is a server that takes requests, processes data and returns a result. The data is statefull and the calls are atomic. The data is object based.

    Given the atomic requirements and the fact that the server side data tends to be shared by different users, different server processess must coordinate their activities. I have devised two schemes to handle this : a master process model and a coordinating processes model.

    # ------------------

    Coordinating Process Model -

    In this model, each server process runs the command issued by the client. Each process loads up the objects from the database and coordinates with other processes by locking the objects. This is the model that I've seen other web servers use. If a process fails to exit, a watcher process may be able to reap it and unlock all objects attached to it. Unfortunately this is slow and memory intensive. It's not exactly the same level of atomicity that I would like, either, as objects could be locked out of order by two processes so deadlocking is a possibility. The implementation for this is rather new and has not yet been put through the paces.

    Master Process Model -

    In this model, the server processes take incoming requests and puts those requests on a queue. A master process checks the queue and invokes the commands, one by one. It then takes the return values and stores them in a shared data structure. The server process checks this shared data structure using coordinated locking signals to detect if the master process is done executing the command. This model is over twice as fast as the coordinating model because the master thread easily caches object values and does not always need to load from the data store. The big drawback of this model is that a particular command could take a long time and one with an infinite loop could potentially strangle the system. The system does set a timeout that a particular command may run. I've been able to run this model months without any crash under light loads. There may be times a long running process must be run. This model doesn't directly address that.

    Some other unthought of way

    There is always an other way to do it. Maybe a model with multiple queues, one slow and one fast, that coordinate object locking. I guess this would be a bit of a hybrid method. <.blockquote>

Connecting Javascript to Perl in Cool Uses for Perl
1 direct reply — Read more / Contribute
by coyocanid
on May 24, 2013 at 14:42

    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?" ) ) );
map grep and sort in Meditations
6 direct replies — Read more / Contribute
by coyocanid
on May 24, 2013 at 13:49

    I want to meditate on some of the most useful perl-isms that, while easy, are oft misunderstood for beginners. I say that, and am possibly projecting, since when I was a beginner, I had not grokked them and had misused them. I also want to give kudos to the comments below as they have greatly helped refine this posting.

    Map, Grep and Sort are not the same thing, but are often used together. Flowing from right to left, they act like shell pipelining in reverse. They build something new, like a tiny little factory. While the original data structure is untouched, it should feel like a list is being transformed every step of the way.

Log In?

What's my password?
Create A New User
[Corion]: marto: Yeah - taking a week off from the kids might be a plan :-D
[choroba]: what island?
[Corion]: choroba: La Palma on the Canary Islands
[choroba]: Ah, we went to Lanzarote 2 years ago with the kids and it was OK
[Corion]: choroba: I was there last year, yes, that would be suited a bit better for kids - much more beach and more varied kids friendly landscape than La Palma :)

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (11)
As of 2018-02-23 16:03 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (303 votes). Check out past polls.