use POE qw(Component::Server::TCP Component::IRC); POE::Component::Server::TCP->new( Port => '9999', Address => '0.0.0.0', ClientInput => \&client_input, ); POE::Session->create( package_states => [ main => [qw(_start)], ], ); $poe_kernel->run(); sub _start { print "My session has id: ", $_[SESSION]->ID(), "\n"; } sub client_input { print "Starting bot in session: ", $_[SESSION]->ID(), "\n"; }