I don't have an answer from experience, but I would say the "state of the art" would be something using an event framework (
AnyEvent,
Mojo::IOLoop or
IO::Async). I can vouch for the skill of the author of Bot::IRC, but it doesn't look like he used an event library. Meanwhile, I see
AnyEvent::IRC which hasn't been updated in 10 years, but looks decent.