poe
Sponsored Links
Sponsored Links
Secleted [ 0 ] software to compare
Results 1 - 15 of about 74
Poe 0.5.1
Poe is a Pugnacious Ogg Editor. more>>
Poe is a Pugnacious Ogg Editor.
Poe is a vorbis comment editor. It tries to follow the vorbis comment header specification closely, while being convenient and flexible to use.
Towards that end, it doesnt have a static form style interface. Instead, it has an editable table of comments.
The contents of the table change dependent upon preference settings, and what comments are in the ogg file you are editing.
Main features:
- Allows multiple Artist, Performer, and Genre fields.
- Flexible choice of comment fields to edit.
- Allows editing of all the comment fields in a file, not just the ones Poe is aware of.
- Full source code available.
- Free: Released under the GNU General Public Licence 2.0
<<lessPoe is a vorbis comment editor. It tries to follow the vorbis comment header specification closely, while being convenient and flexible to use.
Towards that end, it doesnt have a static form style interface. Instead, it has an editable table of comments.
The contents of the table change dependent upon preference settings, and what comments are in the ogg file you are editing.
Main features:
- Allows multiple Artist, Performer, and Genre fields.
- Flexible choice of comment fields to edit.
- Allows editing of all the comment fields in a file, not just the ones Poe is aware of.
- Full source code available.
- Free: Released under the GNU General Public Licence 2.0
Download (0.073MB)
Added: 2005-11-10 License: GPL (GNU General Public License) Price:
1443 downloads
POE::Loop 0.3502
POE::Loop is a documentation for POEs event loop bridge interface. more>>
POE::Loop is a documentation for POEs event loop bridge interface.
SYNOPSIS
$kernel->loop_initialize();
$kernel->loop_finalize();
$kernel->loop_do_timeslice();
$kernel->loop_run();
$kernel->loop_halt();
$kernel->loop_watch_signal($signal_name);
$kernel->loop_ignore_signal($signal_name);
$kernel->loop_attach_uidestroy($gui_window);
$kernel->loop_resume_time_watcher($next_time);
$kernel->loop_reset_time_watcher($next_time);
$kernel->loop_pause_time_watcher();
$kernel->loop_watch_filehandle($handle, $mode);
$kernel->loop_ignore_filehandle($handle, $mode);
$kernel->loop_pause_filehandle($handle, $mode);
$kernel->loop_resume_filehandle($handle, $mode);
POEs runtime kernel abstraction uses the "bridge" pattern to encapsulate services provided by different event loops. This abstraction allows POE to cooperate with several event loops and support new ones with a minimum amount of work.
POE relies on a relatively small number of event loop services: signal callbacks, time or alarm callbacks, and filehandle activity callbacks.
The rest of the bridge interface is administrative trivia such as initializing, executing, and finalizing event loop.
POE::Kernel uses POE::Loop classes internally as a result of detecting which event loop is loaded before POE is. You should almost never need to use a POE::Loop class directly, although there is some early support for doing so in cases where its absolutely necessary.
See "Using POE with Other Event Loops" in POE::Kernel for details about actually using POE with other event loops.
<<lessSYNOPSIS
$kernel->loop_initialize();
$kernel->loop_finalize();
$kernel->loop_do_timeslice();
$kernel->loop_run();
$kernel->loop_halt();
$kernel->loop_watch_signal($signal_name);
$kernel->loop_ignore_signal($signal_name);
$kernel->loop_attach_uidestroy($gui_window);
$kernel->loop_resume_time_watcher($next_time);
$kernel->loop_reset_time_watcher($next_time);
$kernel->loop_pause_time_watcher();
$kernel->loop_watch_filehandle($handle, $mode);
$kernel->loop_ignore_filehandle($handle, $mode);
$kernel->loop_pause_filehandle($handle, $mode);
$kernel->loop_resume_filehandle($handle, $mode);
POEs runtime kernel abstraction uses the "bridge" pattern to encapsulate services provided by different event loops. This abstraction allows POE to cooperate with several event loops and support new ones with a minimum amount of work.
POE relies on a relatively small number of event loop services: signal callbacks, time or alarm callbacks, and filehandle activity callbacks.
The rest of the bridge interface is administrative trivia such as initializing, executing, and finalizing event loop.
POE::Kernel uses POE::Loop classes internally as a result of detecting which event loop is loaded before POE is. You should almost never need to use a POE::Loop class directly, although there is some early support for doing so in cases where its absolutely necessary.
See "Using POE with Other Event Loops" in POE::Kernel for details about actually using POE with other event loops.
Download (0.32MB)
Added: 2006-07-12 License: Perl Artistic License Price:
1200 downloads
POE::Kernel 0.3502
POE::Kernel is an event driven threaded application kernel in Perl. more>>
POE::Kernel is an event driven threaded application kernel in Perl.
SYNOPSIS
POE comes with its own event loop, which is based on select() and written entirely in Perl. To use it, simply:
use POE;
POE can adapt itself to work with other event loops and I/O multiplex systems. Currently it adapts to Gtk, Tk, Event.pm, or IO::Poll when one of those modules is used before POE::Kernel.
use Gtk; # Or Tk, Event, or IO::Poll;
use POE;
or
use POE qw(Loop::Gtk);
or
use POE::Kernel { loop => "Gtk" };
use POE::Session;
Methods to manage the process global Kernel instance:
# Retrieve the kernels unique identifier.
$kernel_id = $kernel->ID;
# Run the event loop, only returning when it has no more sessions to
# dispatch events to. Supports two forms.
$poe_kernel->run();
POE::Kernel->run();
FIFO event methods:
# Post an event to an arbitrary session.
$kernel->post( $session, $event, @event_args );
# Post an event back to the current session.
$kernel->yield( $event, @event_args );
# Call an event handler synchronously. Bypasses POEs event queue
# and returns the handlers return value.
$handler_result = $kernel->call( $session, $event, @event_args );
Original alarm and delay methods:
# Post an event which will be delivered at a given Unix epoch time.
# This clears previous timed events with the same state name.
$kernel->alarm( $event, $epoch_time, @event_args );
# Post an additional alarm, leaving existing ones in the queue.
$kernel->alarm_add( $event, $epoch_time, @event_args );
# Post an event which will be delivered after a delay, specified in
# seconds hence. This clears previous timed events with the same
# name.
$kernel->delay( $event, $seconds, @event_args );
# Post an additional delay, leaving existing ones in the queue.
$kernel->delay_add( $event, $seconds, @event_args );
<<lessSYNOPSIS
POE comes with its own event loop, which is based on select() and written entirely in Perl. To use it, simply:
use POE;
POE can adapt itself to work with other event loops and I/O multiplex systems. Currently it adapts to Gtk, Tk, Event.pm, or IO::Poll when one of those modules is used before POE::Kernel.
use Gtk; # Or Tk, Event, or IO::Poll;
use POE;
or
use POE qw(Loop::Gtk);
or
use POE::Kernel { loop => "Gtk" };
use POE::Session;
Methods to manage the process global Kernel instance:
# Retrieve the kernels unique identifier.
$kernel_id = $kernel->ID;
# Run the event loop, only returning when it has no more sessions to
# dispatch events to. Supports two forms.
$poe_kernel->run();
POE::Kernel->run();
FIFO event methods:
# Post an event to an arbitrary session.
$kernel->post( $session, $event, @event_args );
# Post an event back to the current session.
$kernel->yield( $event, @event_args );
# Call an event handler synchronously. Bypasses POEs event queue
# and returns the handlers return value.
$handler_result = $kernel->call( $session, $event, @event_args );
Original alarm and delay methods:
# Post an event which will be delivered at a given Unix epoch time.
# This clears previous timed events with the same state name.
$kernel->alarm( $event, $epoch_time, @event_args );
# Post an additional alarm, leaving existing ones in the queue.
$kernel->alarm_add( $event, $epoch_time, @event_args );
# Post an event which will be delivered after a delay, specified in
# seconds hence. This clears previous timed events with the same
# name.
$kernel->delay( $event, $seconds, @event_args );
# Post an additional delay, leaving existing ones in the queue.
$kernel->delay_add( $event, $seconds, @event_args );
Download (0.032MB)
Added: 2006-07-12 License: Perl Artistic License Price:
1200 downloads
POE::Stage 0.02_00
POE::Stage is a base Perl class for message-driven objects. more>>
POE::Stage is a base Perl class for message-driven objects.
SYNOPSIS
#!/usr/bin/env perl
{
package App;
use POE::Stage::App qw(:base);
sub on_run {
print "hello, ", my $arg_whom, "!n";
}
}
App->new()->run( whom => "world" );
exit;
POE::Stage is a set of base classes for message-driven objects. It cleanly implements standard patterns that have emerged from years of working with POE and POE::Component modules.
As I hope the name implies, POE::Stage objects encapsulate discrete steps, or stages, of a larger task. Eventually they come together to implement programs.
For example, HTTP requests are performed in four or so distinct stages: 1. The servers address is resolved. 2. The client establishes a connection to the server. 3. The client transmits a request. 4. The client receives a response.
By design, POE::Stage promotes the decomposition of tasks into multiple, smaller stages. If these stages are generic enough, new tasks may be handled by reusing them in different configurations.
The hypothetical HTTP client might be a single stage composed of three smaller ones: A DNS resolver stage, which accepts DNS requests and returns DNS responses. A TCP client connection factory, which takes socket endpoint descriptions and other parameters, and eventually returns established connections. Finally, there would be an HTTP protocol stage that uses established connections to send requests and parse responses.
These stages would be encapsulated by a higher-level HTTP client stage. This would accept HTTP requests and return HTTP responses after performing the necessary steps to gather them.
This will sound familiar to anyone working with objects.
These objects are asynchronous and message-driven, however. The base message class, POE::Request, and its subclasses, implement a standard request/response interface between POE::Stage objects. Where possible, these messages attempt to mimic simpler, more direct call/return syntax, albeit asynchronously. POE::Stage also provides a powerful closure-based system for maintaining request and response state, so you dont have to.
<<lessSYNOPSIS
#!/usr/bin/env perl
{
package App;
use POE::Stage::App qw(:base);
sub on_run {
print "hello, ", my $arg_whom, "!n";
}
}
App->new()->run( whom => "world" );
exit;
POE::Stage is a set of base classes for message-driven objects. It cleanly implements standard patterns that have emerged from years of working with POE and POE::Component modules.
As I hope the name implies, POE::Stage objects encapsulate discrete steps, or stages, of a larger task. Eventually they come together to implement programs.
For example, HTTP requests are performed in four or so distinct stages: 1. The servers address is resolved. 2. The client establishes a connection to the server. 3. The client transmits a request. 4. The client receives a response.
By design, POE::Stage promotes the decomposition of tasks into multiple, smaller stages. If these stages are generic enough, new tasks may be handled by reusing them in different configurations.
The hypothetical HTTP client might be a single stage composed of three smaller ones: A DNS resolver stage, which accepts DNS requests and returns DNS responses. A TCP client connection factory, which takes socket endpoint descriptions and other parameters, and eventually returns established connections. Finally, there would be an HTTP protocol stage that uses established connections to send requests and parse responses.
These stages would be encapsulated by a higher-level HTTP client stage. This would accept HTTP requests and return HTTP responses after performing the necessary steps to gather them.
This will sound familiar to anyone working with objects.
These objects are asynchronous and message-driven, however. The base message class, POE::Request, and its subclasses, implement a standard request/response interface between POE::Stage objects. Where possible, these messages attempt to mimic simpler, more direct call/return syntax, albeit asynchronously. POE::Stage also provides a powerful closure-based system for maintaining request and response state, so you dont have to.
Download (0.048MB)
Added: 2007-06-21 License: Perl Artistic License Price:
855 downloads
POE::Session 0.9989
POE::Session is a Perl module for event driven abstract state machine. more>>
POE::Session is a Perl module for event driven abstract state machine.
SYNOPSIS
# Import POE::Session constants.
use POE::Session;
POE::Session->create(
# Inline or coderef states.
inline_states => {
state_one => &coderef_one,
state_two => sub { ... },
},
# Plain and mapped object states.
object_states => [
$object_one => [ state_three, state_four, state_five ],
$object_two => { state_nine => method_nine },
],
# Plain and mapped package states.
package_states => [
$package_one => [ state_six, state_seven, state_eight ],
$package_two => { state_ten => method_ten },
],
# Parameters for the sessions _start state.
args => [ argument_zero, argument_one, ... ],
# Initial options. See the option() method.
options => %options,
# Change the sessions heap representation.
heap => [ ],
);
Other methods:
# Retrieve a sessions unique identifier.
$session_id = $session->ID;
# Retrieve a reference to the sessions heap.
$session_heap = $session->get_heap();
# Set or clear session options.
$session->option( trace => 1, default => 1 );
$session->option( trace );
# Create a postback, then invoke it and pass back additional
# information.
$postback_coderef = $session->postback( $state_name, @state_args );
$postback_coderef->( @additional_args );
# Or do the same thing synchronously
$callback_coderef = $session->callback( $state_name, @state_args );
$retval = $callback_coderef->( @additional_args );
POE::Session combines a runtime context with an event driven state machine. Together they implement a simple cooperatively timesliced thread.
Sessions receive their timeslices as events from POE::Kernel. Each event has two fields, a state name and a session identifier. These fields describe the code to run and the context to run it in, respectively.
Events carry several other fields which will be discussed in the "Predefined Event Fields" section.
States are re-entrant since they are invoked with their runtime contexts. Although its not usually necessary, this re-entrancy allows a single function to be bound to several different sessions, under several different state names.
As sessions run, they post new events through the Kernel. These events may be for themselves or other sessions, in which case they act as a form of inter-session communications. The Kernel can also generate events based on external conditions such as file activity or the passage of time.
POE provides some convenient built-in states with special meanings. They will be covered later on in the "Predefined States" section.
<<lessSYNOPSIS
# Import POE::Session constants.
use POE::Session;
POE::Session->create(
# Inline or coderef states.
inline_states => {
state_one => &coderef_one,
state_two => sub { ... },
},
# Plain and mapped object states.
object_states => [
$object_one => [ state_three, state_four, state_five ],
$object_two => { state_nine => method_nine },
],
# Plain and mapped package states.
package_states => [
$package_one => [ state_six, state_seven, state_eight ],
$package_two => { state_ten => method_ten },
],
# Parameters for the sessions _start state.
args => [ argument_zero, argument_one, ... ],
# Initial options. See the option() method.
options => %options,
# Change the sessions heap representation.
heap => [ ],
);
Other methods:
# Retrieve a sessions unique identifier.
$session_id = $session->ID;
# Retrieve a reference to the sessions heap.
$session_heap = $session->get_heap();
# Set or clear session options.
$session->option( trace => 1, default => 1 );
$session->option( trace );
# Create a postback, then invoke it and pass back additional
# information.
$postback_coderef = $session->postback( $state_name, @state_args );
$postback_coderef->( @additional_args );
# Or do the same thing synchronously
$callback_coderef = $session->callback( $state_name, @state_args );
$retval = $callback_coderef->( @additional_args );
POE::Session combines a runtime context with an event driven state machine. Together they implement a simple cooperatively timesliced thread.
Sessions receive their timeslices as events from POE::Kernel. Each event has two fields, a state name and a session identifier. These fields describe the code to run and the context to run it in, respectively.
Events carry several other fields which will be discussed in the "Predefined Event Fields" section.
States are re-entrant since they are invoked with their runtime contexts. Although its not usually necessary, this re-entrancy allows a single function to be bound to several different sessions, under several different state names.
As sessions run, they post new events through the Kernel. These events may be for themselves or other sessions, in which case they act as a form of inter-session communications. The Kernel can also generate events based on external conditions such as file activity or the passage of time.
POE provides some convenient built-in states with special meanings. They will be covered later on in the "Predefined States" section.
Download (0.35MB)
Added: 2007-04-18 License: Perl Artistic License Price:
919 downloads
POE::Filter::LZW::Progressive 0.1
POE::Filter::LZW::Progressive is a POE filter wrapped around Compress::LZW::Progressive. more>>
POE::Filter::LZW::Progressive is a POE filter wrapped around Compress::LZW::Progressive.
<<less Download (0.010MB)
Added: 2007-04-10 License: GPL (GNU General Public License) Price:
934 downloads
POE::API::Hooks 1.05
POE::API::Hooks is a Perl module to implement lightweight hooks into POE. more>>
POE::API::Hooks is a Perl module to implement lightweight hooks into POE.
SYNOPSIS
use POE;
use POE::API::Hooks;
POE::API::Hooks->add(
before_event_dispatch => &do_something,
after_event_dispatch => &do_something,
before_session_create => &do_something,
after_session_create => &do_something,
before_event_enqueue => &do_something,
after_event_enqueue => &do_something,
);
# ... carry on with life as normal ...
This module adds lightweight hooks into the inner workings of POE. Currently, one can add hooks into POE that get called before/after an event is dispatched, before/after a Session is created, and/or before/after an event is enqueued. These callbacks receive the exact same argument list as their Kernel/Session counterpart. For event dispatch related callbacks, see _dispatch_event and _data_ev_enqueue in POE::Kernel. For session related callbacks, see create in POE::Session.
<<lessSYNOPSIS
use POE;
use POE::API::Hooks;
POE::API::Hooks->add(
before_event_dispatch => &do_something,
after_event_dispatch => &do_something,
before_session_create => &do_something,
after_session_create => &do_something,
before_event_enqueue => &do_something,
after_event_enqueue => &do_something,
);
# ... carry on with life as normal ...
This module adds lightweight hooks into the inner workings of POE. Currently, one can add hooks into POE that get called before/after an event is dispatched, before/after a Session is created, and/or before/after an event is enqueued. These callbacks receive the exact same argument list as their Kernel/Session counterpart. For event dispatch related callbacks, see _dispatch_event and _data_ev_enqueue in POE::Kernel. For session related callbacks, see create in POE::Session.
Download (0.005MB)
Added: 2007-04-05 License: Perl Artistic License Price:
932 downloads
POE::Loop::Event 0.3502
POE::Loop::Event is a bridge that supports Gtks event loop from POE. more>>
POE::Loop::Event is a bridge that supports Gtks event loop from POE.
SYNOPSIS
See POE::Loop.
This class is an implementation of the abstract POE::Loop interface. It follows POE::Loops public interface exactly. Therefore, please see POE::Loop for its documentation.
<<lessSYNOPSIS
See POE::Loop.
This class is an implementation of the abstract POE::Loop interface. It follows POE::Loops public interface exactly. Therefore, please see POE::Loop for its documentation.
Download (0.32MB)
Added: 2006-07-18 License: Perl Artistic License Price:
1193 downloads
POE::API::Peek 1.0802
POE::API::Peek is a Perl module to peek into the internals of a running POE environment. more>>
POE::API::Peek is a Perl module to peek into the internals of a running POE environment.
POE::API::Peek extends the POE::Kernel interface to provide clean access to Kernel internals in a cross-version compatible manner. Other calculated data is also available.
My intention is to provide massive amounts of internal data for use in POE debugging.
WARNING
This version of this module is certified against POE version 0.38 and above. It will fail on any other POE version.
Further, this module requires perl v5.6.1 or above.
METHODS
new
my $api = POE::API::Peek->new();
Returns a blessed reference. Takes no parameters.
id
my $foo = $api->id();
Obtain the unique id for the kernel. Takes no parameters. Returns a scalar containing a string.
KERNEL UTILITIES
is_kernel_running
if($api->is_kernel_running) {
# do stuff...
}
Tell if the POE Kernel is running and active. Returns 1 if the Kernel is running and 0 if it is not.
active_event
my $event = $api->active_event();
Get the active event name. Returns a string containing the event name.
kernel_memory_size
my $size = $api->kernel_memory_size();
Get the memory footprint of the kernel and consequently the entire POE environment. See the Devel::Size documentation for several caveats involved in this metric.
event_list
my $events = $api->event_list();
Gets the list of events for the whole POE environment. Returns a hash with the session IDs as the keys and a list of events as the values.
which_loop
my $loop_name = $api->which_loop();
Tell which Loop POE has decided to use. Returns the string name of the Loop module.
<<lessPOE::API::Peek extends the POE::Kernel interface to provide clean access to Kernel internals in a cross-version compatible manner. Other calculated data is also available.
My intention is to provide massive amounts of internal data for use in POE debugging.
WARNING
This version of this module is certified against POE version 0.38 and above. It will fail on any other POE version.
Further, this module requires perl v5.6.1 or above.
METHODS
new
my $api = POE::API::Peek->new();
Returns a blessed reference. Takes no parameters.
id
my $foo = $api->id();
Obtain the unique id for the kernel. Takes no parameters. Returns a scalar containing a string.
KERNEL UTILITIES
is_kernel_running
if($api->is_kernel_running) {
# do stuff...
}
Tell if the POE Kernel is running and active. Returns 1 if the Kernel is running and 0 if it is not.
active_event
my $event = $api->active_event();
Get the active event name. Returns a string containing the event name.
kernel_memory_size
my $size = $api->kernel_memory_size();
Get the memory footprint of the kernel and consequently the entire POE environment. See the Devel::Size documentation for several caveats involved in this metric.
event_list
my $events = $api->event_list();
Gets the list of events for the whole POE environment. Returns a hash with the session IDs as the keys and a list of events as the values.
which_loop
my $loop_name = $api->which_loop();
Tell which Loop POE has decided to use. Returns the string name of the Loop module.
Download (0.021MB)
Added: 2007-05-03 License: Perl Artistic License Price:
904 downloads
POE::Exceptions 0.0502
POE::Exceptions is a POE class for handling exceptions. more>>
POE::Exceptions is a POE class for handling exceptions.
SYNOPSIS
use POE::Exceptions;
POE::Session::Exception->create(
inline_states => {
_start => sub { print START;
$_[KERNEL]->sig(DIE,death_handled);
},
death_handled => sub { print EXCEPTION CAUGHT
$_[KERNEL]->sig_handled();
},
_stop => { print END }
}
);
$poe_kernel->run();
DEPRECATION
This module is deprecated as its functionality has been rolled into the POE core, as of POE 0.33. This module will receive no updates and will be removed from CPAN at some point in the near future.
DISCUSSION
POE::Exceptions extends POE to catch exceptions neatly. A new signal, DIE, is introduced. This signal will be fired every time an exception occurs. (For those of you new to the term exception, an exception is whenever the code decides to bail out by dieing.) If the signal handler returns 1 (as in the example above), POE will assume that the handler dealt with the signal appropriately. If the signal handler returns 0, POE will assume that the handler does not want to deal with the signal and POE will propgate the exception as if the handler never existed.
Caveat: POE::Exceptions will die on its own in the case of a double exception fault. If the DIE signal handler itself throws an exception, POE::Exceptions will shut the program down and bail out.
<<lessSYNOPSIS
use POE::Exceptions;
POE::Session::Exception->create(
inline_states => {
_start => sub { print START;
$_[KERNEL]->sig(DIE,death_handled);
},
death_handled => sub { print EXCEPTION CAUGHT
$_[KERNEL]->sig_handled();
},
_stop => { print END }
}
);
$poe_kernel->run();
DEPRECATION
This module is deprecated as its functionality has been rolled into the POE core, as of POE 0.33. This module will receive no updates and will be removed from CPAN at some point in the near future.
DISCUSSION
POE::Exceptions extends POE to catch exceptions neatly. A new signal, DIE, is introduced. This signal will be fired every time an exception occurs. (For those of you new to the term exception, an exception is whenever the code decides to bail out by dieing.) If the signal handler returns 1 (as in the example above), POE will assume that the handler dealt with the signal appropriately. If the signal handler returns 0, POE will assume that the handler does not want to deal with the signal and POE will propgate the exception as if the handler never existed.
Caveat: POE::Exceptions will die on its own in the case of a double exception fault. If the DIE signal handler itself throws an exception, POE::Exceptions will shut the program down and bail out.
Download (0.010MB)
Added: 2007-05-24 License: Perl Artistic License Price:
883 downloads
POE::Component::OSCAR 0.05
POE::Component::OSCAR is a POE component for the Net::OSCAR module. more>>
POE::Component::OSCAR is a POE component for the Net::OSCAR module.
SYNOPSIS
use POE qw(Component::OSCAR);
[ ... POE set up ... ]
sub _start { # start an OSCAR session $oscar = POE::Component::OSCAR->new();
# start an OSCAR session with automatic throttling of new connections
# to prevent being banned by the server
$oscar = POE::Component::OSCAR->new( throttle => 4 );
# set up the "im_in" callback to call your state, "im_in_state"
$oscar->set_callback( im_in => im_in_state);
# its good to detect errors if you dont want to get banned
$oscar->set_callback( error => error_state );
$oscar->set_callback( admin_error => admin_erro_stater );
$oscar->set_callback( rate_alert => rate_alert_state );
# sign on
$oscar->signon( screenname => $MY_SCREENNAME, password => $MY_PASSWORD );
}
sub im_in_state { my ($nothing, $args) = @_[ARG0..$#_]; my ($object, $who, $what, $away) = @$args;
print "Got $what from $whon";
}
<<lessSYNOPSIS
use POE qw(Component::OSCAR);
[ ... POE set up ... ]
sub _start { # start an OSCAR session $oscar = POE::Component::OSCAR->new();
# start an OSCAR session with automatic throttling of new connections
# to prevent being banned by the server
$oscar = POE::Component::OSCAR->new( throttle => 4 );
# set up the "im_in" callback to call your state, "im_in_state"
$oscar->set_callback( im_in => im_in_state);
# its good to detect errors if you dont want to get banned
$oscar->set_callback( error => error_state );
$oscar->set_callback( admin_error => admin_erro_stater );
$oscar->set_callback( rate_alert => rate_alert_state );
# sign on
$oscar->signon( screenname => $MY_SCREENNAME, password => $MY_PASSWORD );
}
sub im_in_state { my ($nothing, $args) = @_[ARG0..$#_]; my ($object, $who, $what, $away) = @$args;
print "Got $what from $whon";
}
Download (0.006MB)
Added: 2007-04-18 License: Perl Artistic License Price:
919 downloads
POE::Component::IRC 4.93
POE::Component::IRC is a fully event-driven IRC client module. more>>
POE::Component::IRC is a fully event-driven IRC client module.
SYNOPSIS
# A simple Rot13 encryption bot
use strict;
use warnings;
use POE qw(Component::IRC);
my $nickname = Flibble . $$;
my $ircname = Flibble the Sailor Bot;
my $ircserver = irc.blahblahblah.irc;
my $port = 6667;
my @channels = ( #Blah, #Foo, #Bar );
# We create a new PoCo-IRC object and component.
my $irc = POE::Component::IRC->spawn(
nick => $nickname,
server => $ircserver,
port => $port,
ircname => $ircname,
) or die "Oh noooo! $!";
POE::Session->create(
package_states => [
main => [ qw(_default _start irc_001 irc_public) ],
],
heap => { irc => $irc },
);
$poe_kernel->run();
exit 0;
sub _start {
my ($kernel,$heap) = @_[KERNEL,HEAP];
# We get the session ID of the component from the object
# and register and connect to the specified server.
my $irc_session = $heap->{irc}->session_id();
$kernel->post( $irc_session => register => all );
$kernel->post( $irc_session => connect => { } );
undef;
}
sub irc_001 {
my ($kernel,$sender) = @_[KERNEL,SENDER];
# Get the components object at any time by accessing the heap of
# the SENDER
my $poco_object = $sender->get_heap();
print "Connected to ", $poco_object->server_name(), "n";
# In any irc_* events SENDER will be the PoCo-IRC session
$kernel->post( $sender => join => $_ ) for @channels;
undef;
}
sub irc_public {
my ($kernel,$sender,$who,$where,$what) = @_[KERNEL,SENDER,ARG0,ARG1,ARG2];
my $nick = ( split /!/, $who )[0];
my $channel = $where->[0];
if ( my ($rot13) = $what =~ /^rot13 (.+)/ ) {
$rot13 =~ tr[a-zA-Z][n-za-mN-ZA-M];
$kernel->post( $sender => privmsg => $channel => "$nick: $rot13" );
}
undef;
}
# We registered for all events, this will produce some debug info.
sub _default {
my ($event, $args) = @_[ARG0 .. $#_];
my @output = ( "$event: " );
foreach my $arg ( @$args ) {
if ( ref($arg) eq ARRAY ) {
push( @output, "[" . join(" ,", @$arg ) . "]" );
} else {
push ( @output, "$arg" );
}
}
print STDOUT join , @output, "n";
return 0;
}
POE::Component::IRC is a POE component (whod have guessed?) which acts as an easily controllable IRC client for your other POE components and sessions. You create an IRC component and tell it what events your session cares about and where to connect to, and it sends back interesting IRC events when they happen. You make the client do things by sending it events. Thats all there is to it. Cool, no?
[Note that using this module requires some familiarity with the details of the IRC protocol. Id advise you to read up on the gory details of RFC 1459 before you get started. Keep the list of server numeric codes handy while you program. Needless to say, youll also need a good working knowledge of POE, or this document will be of very little use to you.]
The POE::Component::IRC distribution has a docs/ folder with a collection of salient documentation including the pertinent RFCs.
POE::Component::IRC consists of a POE::Session that manages the IRC connection and dispatches irc_ prefixed events to interested sessions and an object that can be used to access additional information using methods.
Sessions register their interest in receiving irc_ events by sending register to the component. One would usually do this in your _start handler. Your session will continue to receive events until you unregister. The component will continue to stay around until you tell it not to with shutdown.
The SYNOPSIS demonstrates a fairly basic bot.
<<lessSYNOPSIS
# A simple Rot13 encryption bot
use strict;
use warnings;
use POE qw(Component::IRC);
my $nickname = Flibble . $$;
my $ircname = Flibble the Sailor Bot;
my $ircserver = irc.blahblahblah.irc;
my $port = 6667;
my @channels = ( #Blah, #Foo, #Bar );
# We create a new PoCo-IRC object and component.
my $irc = POE::Component::IRC->spawn(
nick => $nickname,
server => $ircserver,
port => $port,
ircname => $ircname,
) or die "Oh noooo! $!";
POE::Session->create(
package_states => [
main => [ qw(_default _start irc_001 irc_public) ],
],
heap => { irc => $irc },
);
$poe_kernel->run();
exit 0;
sub _start {
my ($kernel,$heap) = @_[KERNEL,HEAP];
# We get the session ID of the component from the object
# and register and connect to the specified server.
my $irc_session = $heap->{irc}->session_id();
$kernel->post( $irc_session => register => all );
$kernel->post( $irc_session => connect => { } );
undef;
}
sub irc_001 {
my ($kernel,$sender) = @_[KERNEL,SENDER];
# Get the components object at any time by accessing the heap of
# the SENDER
my $poco_object = $sender->get_heap();
print "Connected to ", $poco_object->server_name(), "n";
# In any irc_* events SENDER will be the PoCo-IRC session
$kernel->post( $sender => join => $_ ) for @channels;
undef;
}
sub irc_public {
my ($kernel,$sender,$who,$where,$what) = @_[KERNEL,SENDER,ARG0,ARG1,ARG2];
my $nick = ( split /!/, $who )[0];
my $channel = $where->[0];
if ( my ($rot13) = $what =~ /^rot13 (.+)/ ) {
$rot13 =~ tr[a-zA-Z][n-za-mN-ZA-M];
$kernel->post( $sender => privmsg => $channel => "$nick: $rot13" );
}
undef;
}
# We registered for all events, this will produce some debug info.
sub _default {
my ($event, $args) = @_[ARG0 .. $#_];
my @output = ( "$event: " );
foreach my $arg ( @$args ) {
if ( ref($arg) eq ARRAY ) {
push( @output, "[" . join(" ,", @$arg ) . "]" );
} else {
push ( @output, "$arg" );
}
}
print STDOUT join , @output, "n";
return 0;
}
POE::Component::IRC is a POE component (whod have guessed?) which acts as an easily controllable IRC client for your other POE components and sessions. You create an IRC component and tell it what events your session cares about and where to connect to, and it sends back interesting IRC events when they happen. You make the client do things by sending it events. Thats all there is to it. Cool, no?
[Note that using this module requires some familiarity with the details of the IRC protocol. Id advise you to read up on the gory details of RFC 1459 before you get started. Keep the list of server numeric codes handy while you program. Needless to say, youll also need a good working knowledge of POE, or this document will be of very little use to you.]
The POE::Component::IRC distribution has a docs/ folder with a collection of salient documentation including the pertinent RFCs.
POE::Component::IRC consists of a POE::Session that manages the IRC connection and dispatches irc_ prefixed events to interested sessions and an object that can be used to access additional information using methods.
Sessions register their interest in receiving irc_ events by sending register to the component. One would usually do this in your _start handler. Your session will continue to receive events until you unregister. The component will continue to stay around until you tell it not to with shutdown.
The SYNOPSIS demonstrates a fairly basic bot.
Download (0.23MB)
Added: 2006-06-15 License: Perl Artistic License Price:
1227 downloads
POE::Filter::HTTPD 0.3601
POE::Filter::HTTPD is a Perl module to convert stream to HTTP::Request; HTTP::Response to stream. more>>
POE::Filter::HTTPD is a Perl module to convert stream to HTTP::Request; HTTP::Response to stream.
SYNOPSIS
$httpd = POE::Filter::HTTPD->new();
$arrayref_with_http_response_as_string =
$httpd->put($full_http_response_object);
$arrayref_with_http_request_object =
$line->get($arrayref_of_raw_data_chunks_from_driver);
The HTTPD filter parses the first HTTP 1.0 request from an incoming stream into an HTTP::Request object (if the request is good) or an HTTP::Response object (if the request was malformed). To send a response, give its put() method a HTTP::Response object.
Here is a sample input handler:
sub got_request {
my ($heap, $request) = @_[HEAP, ARG0];
# The Filter::HTTPD generated a response instead of a request.
# There must have been some kind of error. You could also check
# (ref($request) eq HTTP::Response).
if ($request->isa(HTTP::Response)) {
$heap->{wheel}->put($request);
return;
}
# Process the request here.
my $response = HTTP::Response->new(200);
$response->push_header( Content-Type, text/html );
$response->content( $request->as_string() );
$heap->{wheel}->put($response);
}
Please see the documentation for HTTP::Request and HTTP::Response.POE::Filter::HTTPD is a Perl module to convert stream to HTTP::Request; HTTP::Response to stream.
<<lessSYNOPSIS
$httpd = POE::Filter::HTTPD->new();
$arrayref_with_http_response_as_string =
$httpd->put($full_http_response_object);
$arrayref_with_http_request_object =
$line->get($arrayref_of_raw_data_chunks_from_driver);
The HTTPD filter parses the first HTTP 1.0 request from an incoming stream into an HTTP::Request object (if the request is good) or an HTTP::Response object (if the request was malformed). To send a response, give its put() method a HTTP::Response object.
Here is a sample input handler:
sub got_request {
my ($heap, $request) = @_[HEAP, ARG0];
# The Filter::HTTPD generated a response instead of a request.
# There must have been some kind of error. You could also check
# (ref($request) eq HTTP::Response).
if ($request->isa(HTTP::Response)) {
$heap->{wheel}->put($request);
return;
}
# Process the request here.
my $response = HTTP::Response->new(200);
$response->push_header( Content-Type, text/html );
$response->content( $request->as_string() );
$heap->{wheel}->put($response);
}
Please see the documentation for HTTP::Request and HTTP::Response.POE::Filter::HTTPD is a Perl module to convert stream to HTTP::Request; HTTP::Response to stream.
Download (0.33MB)
Added: 2006-08-24 License: Perl Artistic License Price:
1156 downloads
POE::Filter::ErrorProof 1.0
POE::Filter::ErrorProof is a POE::Filter wrapper around dangerous Filters. more>>
SYNOPSIS
use POE::Filter::ErrorProof;
my $wheel = POE::Wheel::ReadWrite->new(
Filter => POE::Filter::ErrorProof->new(POE::Filter::Something->new()),
);
This module is a wrapper around other POE::Filters. I made this module when I noticed POE::Filter::XML would die() when non-XML input was given to it. The author of the module wasnt there, so I had to bring up a solution. You can use this module if you use a POE::Filter that might die if something bad happens. This Filter does nothing more than giving through the input in eval blocks.
THE NEW METHOD
POE::Filter::ErrorProof->new(); # Create a POE::Filter::ErrorProof with a POE::Filter::Stream in it
POE::Filter::ErrorProof->new(POE::Filter::XML->new()); # Do the same but with a POE::Filter::XML
POE::Filter::ErrorProof->new(POE::Filter::XML->new(), 1); # Do the same, but output errors on STDERR
POE::Filter::ErrorProof->new(POE::Filter::XML->new(), $socket); # Do the same, but output errors on this socket
$wheel = POE::Wheel::ReadWrite->new( .... );
POE::Filter::ErrorProof->new(POE::Filter::XML->new(), $wheel); # Output errors to this wheel
Download (0.008MB)
Added: 2007-04-18 License: Perl Artistic License Price:
919 downloads
POE::Wheel::Audio::Mad 0.3
POE::Wheel::Audio::Mad is a POE Wheel implementing in-session non-blocking mpeg stream playing. more>>
POE::Wheel::Audio::Mad is a POE Wheel implementing in-session non-blocking mpeg stream playing.
SYNOPSIS
use POE;
use POE::Wheel::Audio::Mad;
POE::Session->create(
inline_states => {
_start => &am_start,
message => &am_message
}
);
sub am_start {
my ($kernel, $heap) = @_[KERNEL, HEAP];
## you may also specify decoder options, listed below..
$heap->{wheel} = new POE::Wheel::Audio::Mad ( message_event => message );
$kernel->yield( decoder_open, {
filename => /path/to/some/stream.mp3,
play => 1
});
}
sub am_message {
my ($kernel, $message) = @_[KERNEL, ARG0];
if ($message->{id} eq INPUT_EOF_WARNING) {
print "finished..n";
undef $heap->{wheel};
} elsif ($message->{id} eq DECODER_FRAME_DATA) {
if (defined($message->{data}->{played})) {
print "rplayed: $message->{data}->{played}";
}
}
}
$poe_kernel->run();
exit();
POE::Wheel::Audio::Mad is an attempt to bring a naitive perl mpeg decoder into a perl session. This module was written to work as a POE Wheel due to its nature -- it simply playes mpeg streams -- you have to do the job of controlling the player and handling updates. This really isnt your traditional wheel.
<<lessSYNOPSIS
use POE;
use POE::Wheel::Audio::Mad;
POE::Session->create(
inline_states => {
_start => &am_start,
message => &am_message
}
);
sub am_start {
my ($kernel, $heap) = @_[KERNEL, HEAP];
## you may also specify decoder options, listed below..
$heap->{wheel} = new POE::Wheel::Audio::Mad ( message_event => message );
$kernel->yield( decoder_open, {
filename => /path/to/some/stream.mp3,
play => 1
});
}
sub am_message {
my ($kernel, $message) = @_[KERNEL, ARG0];
if ($message->{id} eq INPUT_EOF_WARNING) {
print "finished..n";
undef $heap->{wheel};
} elsif ($message->{id} eq DECODER_FRAME_DATA) {
if (defined($message->{data}->{played})) {
print "rplayed: $message->{data}->{played}";
}
}
}
$poe_kernel->run();
exit();
POE::Wheel::Audio::Mad is an attempt to bring a naitive perl mpeg decoder into a perl session. This module was written to work as a POE Wheel due to its nature -- it simply playes mpeg streams -- you have to do the job of controlling the player and handling updates. This really isnt your traditional wheel.
Download (0.022MB)
Added: 2006-11-16 License: Perl Artistic License Price:
1074 downloads
Secleted [ 0 ] software to compare
Copyright Notice:
Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future software development. The above poe search only lists software in full, demo and trial versions for free download. Download links are directly from our mirror sites or publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed