Objectwize Monks-

I'm trying to learn the musty innards of POE::Component::RemoteTail, and have successfully run a modified version example program listed in the documentation.

use strict; use warnings; use Data::Dumper; use POE; # This should be added to the docs... use POE::Component::RemoteTail; my ( $host, $path, $user ) = (qw(myhost.domain.com /home/mylogin/.profile mylogin)); my $alias = 'Remote_Tail'; # spawn component my $tailer = POE::Component::RemoteTail->spawn( alias=>$alias ); # create job my $job = $tailer->job( host=>$host, path=>$path, user=>$user, ); # prepare the postback subroutine at main POE session POE::Session->create( inline_states=>{ _start=>sub { my ( $kernel, $session ) = @_[ KERNEL, SESSION ]; # create postback my $postback = $session->postback("MyPostback"); # post to execute $kernel->post( $alias, "start_tail"=>{ job=>$job, postback=>$postback } ); }, # return to here MyPostback=>sub { my ( $kernel, $session, $data ) = @_[ KERNEL, SESSION, ARG1 ]; print STDERR "DATA DUMP:\n", Dumper($data), "\n"; }, }, ); POE::Kernel->run();
Now, I'm trying to follow the docs to run the (slightly modified) example script (see readmore below) to use the NetSSHPerl custom engine with this module, that is described in POE::Component::RemoteTail::Engine::NetSSHPerl, and I keep getting the error:

Can't locate object method "new" via package "POE::Component::RemoteTail::CustomEngine::NetSSHPerl" at lib/POE/Component/Remotetail.pm line 102.

I'm suspecting that the object stuff isn't setup correctly in the RemoteTail/CustomEngine/NetSSHPerl.pm file, but I don't know enough to fix it.

use strict; use warnings; use POE; use POE::Component::Remotetail; my ( $host, $path, $user ) = (qw(myhost.domain.com /home/mylogin/.profile mylogin)); my $tailer = POE::Component::RemoteTail->spawn(); my $job = $tailer->job( host => $host, path => $path, user => $user, process_class => "POE::Component::RemoteTail::CustomEngine::NetS +SHPerl" ); POE::Session->create( inline_states => { _start => sub { my $kernel = $_[KERNEL]; $kernel->post($tailer->session_id(), "start_tail" => {jo +b => $job}); $kernel->delay_add("stop_job", 100); }, stop_job => sub { my $kernel = $_[KERNEL]; $kernel->post($tailer->session_id(), "stop_tail" => {job + => $job}); } } ); POE::Kernel->run();
Any help is very much appreciated!

Thanks

-Craig


In reply to POE::Component::RemoteTail - Can't locate object method new by cmv

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.