Created
August 22, 2012 18:06
-
-
Save sycobuny/3428012 to your computer and use it in GitHub Desktop.
Demonstrating a method for breaking long lines
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package POE::Component::dns::monitor::sniffer; | |
use POE; | |
use warnings; | |
use strict; | |
sub spawn { | |
my ($session) = POE::Session->create( | |
inline_states => { | |
_start => sub { | |
print "hi " . $_[SESSION]->ID . "\n @{[join(', ', @_)]}\n" | |
}, | |
_stop => sub { | |
print "bye " . $_[SESSION]->ID . "\n @{[join(', ', @_)]}" | |
}, | |
}, | |
); | |
print "session: $session\n"; | |
$session; | |
} | |
package main; | |
foreach (1..2) { | |
POE::Component::dns::monitor::sniffer->spawn(); | |
} | |
POE::Kernel->run(); | |
1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package POE::Component::dns::monitor::sniffer; | |
use POE; | |
use warnings; | |
use strict; | |
sub spawn { | |
my ($session) = POE::Session->create( | |
inline_states => { | |
_start => sub { print "hi " . $_[SESSION]->ID . "\n @{[join(', ', @_)]}\n" }, | |
_stop => sub { print "bye " . $_[SESSION]->ID . "\n @{[join(', ', @_)]}" }, | |
}, | |
); | |
print "session: $session\n"; | |
$session; | |
} | |
package main; | |
foreach (1..2) { | |
POE::Component::dns::monitor::sniffer->spawn(); | |
} | |
POE::Kernel->run(); | |
1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment