poe

How does variable scoping work in a POE session?

Can anyone explain how variable scoping works within a POE session? What is the proper way to pass state within the session, without impacting other sessions? Thanks Josh ...

How to undersand the POE-Tk use of destroy?

Here is some test code to illustrate my problem; use Tk; use POE qw( Loop::TkActiveState ); use Tk::Toplevel; POE::Session->create( inline_states => { _start => \ } ,over => sub { exit } } ); $poe_kernel->run(); exit 0; sub ui_start { my ($kernel, $session, $heap) = @_[KERNEL, SESSION, HEAP]; $heap->...

Understanding name spaces in POE-Tk

I posted "How to undersand the POE-Tk use of destroy?" in an attempt to reduce the bug in my production code to a test case. But it seems that the solution to the test case is not working in the full program. The program is 800+ lines long so I am hesitant to post it in full. I realize that the snippets I provide here may be too shor...

How do I find the current value of a processes STDOUT in Perl?

I have a POE Perl program forking children. The children it is forking do logging and interactive telnets into remote devices. POE uses STDOUT to return output back up to the parent process but for some reason it's getting lost (not going to screen or to any files). I'm theorising that this is because STDOUT is being redirected somewhe...

How do I check if a user is authenticated with NickServ using POE::Component::IRC::State in Perl?

I'm trying to test whether a user is registered on FreeNode. nick_info() doesn't seem to return information about this, so I want to use $irc->yield(whois => $nick); and then grab the irc_whois event's reply. The problem is that I want to wait until this event is fired, so I created a global variable $whois_result and wrote a sub like th...

Is there a Perl POE module for monitoring a database table for changes?

Is there any Wheel /POCO /Option to do this in Perl using the POE module: I want to monitor a DB table for changed records (deleting /insert/ update) and react accordingly to those changes. If yes could one provide some code or a link that shows this? ...

Where can I find books or tutorials for Perl's POE?

Could someone provide a link to a book on POE (Perl object environment) if there any book like this? Or could someone provide a good tutorial about POE in addtion to the tutorials that found under this site http://poe.perl.org? ...

How do I put an array on the POE heap and push or pop data?

How do I put an array on the POE heap, and push/pop data to/from it? I'm trying to put the following array on the heap: @commands = ( ["quit",\&Harlie::Commands::do_quit,10], ["part",\&Harlie::Commands::do_part,10], ["join",\&Harlie::Commands::do_join,10], ["nick",\&Harlie::Commands::do_nick,10], ["module",\&Harlie:...

How can I identify Windows PnP events with Perl's POE?

Is there a POE module that identifies PnP events in Windows? If yes, could someone provide idea code snippet? ...

How do I correctly shutdown a Bot::BasicBot bot (based on POE::Component::IRC)?

This is a sample script. When I hit Ctrl+C, the bot quits IRC but it reconnects back after some time. How do I shut down the bot correctly? #!/usr/bin/perl package main; my $bot = Perlbot->new (server => 'irc.dal.net'); $SIG{'INT'} = 'Handler'; $SIG{'TERM'} = 'Handler'; sub Handler { print "\nShutting down bot...\n"; $bot->shutdown(...

What's the right way to kill child processes in perl before exiting?

I'm running an IRC Bot (Bot::BasicBot) which has two child processes running File::Tail but when exiting, they don't terminate. So I'm killling them using Proc::ProcessTable like this before exiting: my $parent=$$; my $proc_table=Proc::ProcessTable->new(); for my $proc (@{$proc_table->table()}) { kill(15, $proc->pid) if ($proc->ppid =...

Where can I read a clear explanation of POE (Perl Object Environment)?

I am searching for about a week for a good and clear tutorial for POE that is relevant to 2010 and didn't find one. I found some tutorials in the Stack Overflow question Where can I find books or tutorials for Perl’s POE? under the poe tag but most of the materials are old and not clear. Could someone provide a clear link/lecture/tutor...

monitoring an exe applicaion launching

I need to monitor an console exe application which don't have any stdin from the user it only print some info to the screen i used a POE:Wheel for this task Below are my code: use POE qw( Wheel::Run); POE::Session->create( inline_states => { _start => sub { my ($heap) = $_[HEAP]; my $run ...