Permalink
Browse files

Tweaking to get Makefile.PL working correctly.

  • Loading branch information...
1 parent f022983 commit 372c3a1a7053b101674ff514bf8b2c3782568125 @rcaputo committed Aug 16, 1998
Showing with 43 additions and 26 deletions.
  1. +8 −4 Makefile.PL
  2. +22 −2 lib/POE.pm
  3. +3 −3 samples/forkbomb.perl
  4. +2 −3 samples/selects.perl
  5. +2 −3 samples/sessions.perl
  6. +2 −3 samples/signals.perl
  7. +4 −8 samples/wheels.perl
View
@@ -3,7 +3,11 @@
use ExtUtils::MakeMaker;
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
-WriteMakefile(
- 'NAME' => 'POE',
- 'VERSION_FROM' => 'POE.pm', # finds $VERSION
-);
+WriteMakefile
+ (
+ 'NAME' => 'POE',
+ 'VERSION_FROM' => 'POE.pm',
+ 'dist' => { 'COMPRESS' => 'gzip -9',
+ 'SUFFIX' => 'gz',
+ },
+ );
View
@@ -1,12 +1,25 @@
# $Id$
# Documentation exists after __END__
-
package POE;
-my $VERSION = 1.0;
+$VERSION = "1.00";
use strict;
+use Carp;
+
+sub import {
+ my $self = shift;
+ my @modules = grep(!/^(Kernel|Session)$/, @_);
+ unshift @modules, qw(Kernel Session);
+
+ my @failed;
+ foreach my $module (@modules) {
+ eval("require POE::" . $module) or push(@failed, $module);
+ }
+
+ @failed and croak "could not import qw(" . join(' ', @failed) . ")";
+}
#------------------------------------------------------------------------------
@@ -25,8 +38,15 @@ POE - the Perl Operating Environment
=head1 SYNOPSIS
+use POE;
+
=head1 DESCRIPTION
+In general, POE provides "kernel" services, including C<select(2)>, events
+signals, alarms and reusable boilerplates for common functions.
+
+In specific, POE uses C<POE::Kernel> and C<POE::Session> for you.
+
=head1 CLASSES
=over 4
@@ -1,12 +1,12 @@
-#!perl -w -I../lib
+#!perl -w -I..
# Copyright 1998 Rocco Caputo <troc@netrus.net>. All rights reserved.
# This is a pre-release version. Redistribution and modification are
# prohibited.
package main;
use strict;
-use POE::Kernel;
-use POE::Session;
+
+use POE; # POE::Kernel and POE::Session are included automagically
open STDERR, '>&STDOUT';
@@ -1,10 +1,9 @@
-#!perl -w -I../lib
+#!perl -w -I..
# $Id$
use strict;
-use POE::Kernel;
-use POE::Session;
+use POE; # Kernel and Session are included automagically
use IO::Socket::INET;
use POSIX qw(EAGAIN);
@@ -1,12 +1,11 @@
-#!perl -w -I../lib
+#!perl -w -I..
# Copyright 1998 Rocco Caputo <troc@netrus.net>. All rights reserved.
# This is a pre-release version. Redistribution and modification are
# prohibited.
use strict;
-use POE::Kernel;
-use POE::Session;
+use POE; # Kernel and Session are always included
my $kernel = new POE::Kernel();
@@ -1,12 +1,11 @@
-#!perl -w -I../lib
+#!perl -w -I..
# Copyright 1998 Rocco Caputo <troc@netrus.net>. All rights reserved.
# This is a pre-release version. Redistribution and modification are
# prohibited.
use strict;
-use POE::Kernel;
-use POE::Session;
+use POE; # and you get Kernel and Session
select(STDOUT); $|=1;
View
@@ -1,19 +1,13 @@
-#!perl -w -I../lib
+#!perl -w -I..
# $Id$
# See selects.perl for a lower-level approach to accepting connections,
# driving sockets and filtering IO. Wheels were thunk up to replace the
# most common things in selects.perl with reusable boilerplates.
use strict;
- # need to combine into one happy "use"?
-use POE::Kernel;
-use POE::Session;
-use POE::Wheel::ListenAccept;
-use POE::Wheel::ReadWrite;
-use POE::Driver::SysRW;
-use POE::Filter::Line;
+use POE qw(Wheel::ListenAccept Wheel::ReadWrite Driver::SysRW Filter::Line);
use IO::Socket::INET;
my $kernel = new POE::Kernel();
@@ -65,6 +59,8 @@
( $k,
'_start' => sub
{ my ($k, $me, $from) = @_;
+
+ $k->sig('INT', 'sigint');
# sysread/syswrite/line-filter
$me->{'wheel'} = new POE::Wheel::ReadWrite
( $kernel,

0 comments on commit 372c3a1

Please sign in to comment.