Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Document "use POE" magic.

  • Loading branch information...
commit a57acdabb1bb9e26e5606f85d69e2fe68fecf653 1 parent e17caee
@rcaputo authored
Showing with 23 additions and 2 deletions.
  1. +23 −2 lib/POE.pm
View
25 lib/POE.pm
@@ -79,8 +79,7 @@ POE - portable multitasking and networking framework for Perl
#!/usr/bin/perl -w
use strict;
- # Use POE!
- use POE;
+ use POE; # Auto-includes POE::Kernel and POE::Session.
sub handler_start {
my ($kernel, $heap, $session) = @_[KERNEL, HEAP, SESSION];
@@ -220,6 +219,28 @@ By design, it's possible to implement new POE::Kernel guts by creating
another POE::Resource class. One can then expose the functionality
with a new POE::API mix-in.
+=head1 USING POE
+
+POE's C<import> method implements some magic to cut down on the amount
+of necessary setup.
+
+For starters, C<use POE> will automatically include POE::Kernel. And
+it will also include POE::Session if a session type isn't specified.
+Most programs need both of these modules, so POE gives you them for
+free.
+
+Modules can also be included on the C<use POE> line. The leading
+"POE::" should be omitted when using POE this way:
+
+ use POE qw(Component::Client::TCP).
+
+This is a somewhat abbreviated version of:
+
+ use POE;
+ use POE::Kernel;
+ use POE::Session;
+ use POE::Component::Client::TCP;
+
=head1 DOCUMENTATION ROADMAP
You're reading the main POE documentation. It's the general entry
Please sign in to comment.
Something went wrong with that request. Please try again.