Skip to content

Commit

Permalink
Tweaking to get Makefile.PL working correctly.
Browse files Browse the repository at this point in the history
  • Loading branch information
rcaputo committed Aug 16, 1998
1 parent f022983 commit 372c3a1
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 26 deletions.
12 changes: 8 additions & 4 deletions Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
);
24 changes: 22 additions & 2 deletions lib/POE.pm
Original file line number Diff line number Diff line change
@@ -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) . ")";
}

#------------------------------------------------------------------------------

Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions samples/forkbomb.perl
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
5 changes: 2 additions & 3 deletions samples/selects.perl
Original file line number Diff line number Diff line change
@@ -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);

Expand Down
5 changes: 2 additions & 3 deletions samples/sessions.perl
Original file line number Diff line number Diff line change
@@ -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();

Expand Down
5 changes: 2 additions & 3 deletions samples/signals.perl
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
12 changes: 4 additions & 8 deletions samples/wheels.perl
Original file line number Diff line number Diff line change
@@ -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();
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 372c3a1

Please sign in to comment.