On Wed, Aug 08, 2001 at 02:02:50PM -0400, [EMAIL PROTECTED] wrote:
>
> I was playing around with the sample code in the "Beginner's Introduction
> to POE" article at http://www.perl.com/pub/a/2001/01/poe.html.
>
> Everything works fine, however I get this warning:
>
> SuccessEvent coderefs are depreciated (and will go away after version
> 0.13) at ./poeserver.pl line 18
> FailureEvent coderefs are depreciated (and will go away after version
> 0.13) at ./poeserver.pl line 18
>
> What I'm wondering is... what is recommended, in place of the SuccessEvent
> and FailureEvent coderefs?
I recommend making them full states:
7 new POE::Session (
8 _start => \&server_start,
9 _stop => \&server_stop,
9 1/3 accept_new_client => \&accept_new_client, # <-- here
9 2/3 accept_failed => \&accept_failed, # <-- here
10 );
11 $poe_kernel->run();
12 exit;
... and later:
13 sub server_start {
14 $_[HEAP]->{listener} = new POE::Wheel::SocketFactory
15 ( BindPort => PORT,
16 Reuse => 'yes',
17 SuccessState => 'accept_new_client', # <-- here
18 FailureState => 'accept_failed', # <-- here
19 );
20 print "SERVER: Started listening on port ", PORT, ".\n";
21 }
Nice .signature, by the way. :)
-- Rocco Caputo / [EMAIL PROTECTED] / poe.perl.org / poe.sourceforge.net