Skip to content
Newer
Older
100644 27 lines (20 sloc) 400 Bytes
076f3d8 @rcaputo Start accumulating small example programs for tutorials.
authored Mar 23, 2010
1 #!/usr/bin/env perl
2
3 use warnings;
4 use strict;
5 use POE;
6
7 sub start_saying {
8 my ($what, $delay) = @_;
9
10 my $say_it = sub {
11 print "$what\n";
12 $_[KERNEL]->delay(say_it_again => $delay);
13 };
14
15 POE::Session->create(
16 inline_states => {
17 _start => $say_it,
18 say_it_again => $say_it,
19 },
20 );
21 }
22
23 start_saying("hello", 1);
24 start_saying(" world", 1.5);
25
26 POE::Kernel->run();
Something went wrong with that request. Please try again.