how to convert shell captures into anyevent style?

Zsbán Ambrus ambrus at math.bme.hu
Thu Mar 29 18:48:09 CEST 2012


On 3/29/12, Fulko Hew <fulko.hew at gmail.com> wrote:
>     foreach (`prog|prog|prog`) {
>
> What I obviously need to do is to turn my obtainer() into an event driven
> aspect too!  And I think what I want is an 'IO Watcher', but...

Take a look at the run_cmd function in the AnyEvent::Util module.  It
spawns you a program (in this case you'll ask it spawn a shell so it
interprets all those inner pipe to you) and handles reading its
output.  When it's finished, split the output to lines.

Ambrus



More information about the anyevent mailing list