Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: POE::Component::RemoteTail - Can't locate object method new

by rcaputo (Chaplain)
on Feb 24, 2009 at 17:01 UTC ( #746048=note: print w/replies, xml ) Need Help??


in reply to POE::Component::RemoteTail - Can't locate object method new

If you've correctly spelled "POE::Component::RemoteTail::CustomEngine::NetSSHPerl", then it appears you haven't loaded that module. Will POE::Component::RemoteTail automatically use() it for you? I didn't see that mentioned in a quick skim of the docs....

  • Comment on Re: POE::Component::RemoteTail - Can't locate object method new

Replies are listed 'Best First'.
Re^2: POE::Component::RemoteTail - Can't locate object method new
by cmv (Chaplain) on Feb 24, 2009 at 17:43 UTC
    Rocco-

    Will POE::Component::RemoteTail automatically use() it for you?

    I think so, here's a code excerpt from RemoteTail.pm:

    102 # use custom class 103 if ( my $class = $job->{process_class} ) { 104 $class->require or die(@!); 105 $class->new(); 106 %program = ( Program => sub { $class->process_entry($j +ob) }, ); 107 }
    Also, I added a print statement to the beginning of the NetSSHPerl module, and I saw the print output before the error message came out.

    I'm also confused because I don't understand the meat of the RemoteTail::CustomEngine::NetSSHPerl module:

    use POE::Component::RemoteTail::CustomEngine::NetSSHPerl; use strict; use warnings; use Net::SSH::Perl; print STDERR "In NetSSHPerl...\n"; #Added by cmv sub process_entry { my $self = shift; my $arg = shift; my $host = $arg->{host}; my $path = $arg->{path}; my $user = $arg->{user}; my $password = $arg->{password}; my $cmd = "tail -f $path"; my $ssh = Net::SSH::Perl->new( $host, protocol => "2,1" ); $ssh->login($user); $ssh->register_handler( "stdout", sub { my ( $channel, $buffer ) = @_; my $log = $buffer->bytes; print $log; unless ($log) { exit; } } ); my ( $stdout, $stderr, $exit ) = $ssh->cmd($cmd); } 1;
    Why does it have a use statement pointing to itself?
    Shouldn't it have a module declaration instead?

    I'm confused.

      That does look bizarre. Off the top of my head, I would expect the use statement to be package and perhaps it's missing a use base pragma.

      This module seems to need some love. Maybe the author would be willing to heap some on it if they knew someone was trying to use it?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://746048]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2022-10-05 00:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred way to holiday/vacation is:











    Results (20 votes). Check out past polls.

    Notices?