in reply to Data structures not returned via POE::Filter::Reference

As I see it, your plugin is calling print("task....") which is not in the POE::Filter::Reference format. The parent process is trying to parse the child's output in a particular format, which it's not getting. As a result, the parent isn't displaying the output.

You can use STDERR as a plaintext back channel. Change the print() to warn(), and set up the POE::Wheel::Run object to use POE::Filter::Line for its StderrFilter:

$_[HEAP]{child} = POE::Wheel::Run( ... stuff ..., StdinFilter => POE::Filter::Reference->new(), StdoutFilter => POE::Filter::Reference->new(), StderrFilter => POE::Filter::Line->new(), );
Untested, of course. :)

Then handle StderrEvent in the parent. As an added bonus, any errors or warnings in the child will be displayed by the parent. It's great for debugging the child process.

Replies are listed 'Best First'.
Re^2: Data structures not returned via POE::Filter::Reference
by swares (Monk) on Apr 08, 2008 at 16:21 UTC
    With the print statements commented it is still not returning data from certain plugins (LDAP queries and SSH sessions) but I do see all parts of the data were printed into the nohup.out log. Here is an example of the return data (I did a cat on a remote /etc/passwd file) as viewed with vi. The data is returned from a plugin using Net::SSH2 since Net::SSH::Perl seems to be broken now on my dev boxes.
    ^@^@^@^Fresult147^@^E^G^C^@^@^@^D ^Fswares^@^@^@^Hreply_to )[ssh2] halt:x:7:0:halt:/sbin:/sbin/halt ^@^@^@^Fstatus ^Dssh2^@^@^@^Dtask )[ssh2] halt:x:7:0:halt:/sbin:/sbin/halt