my %actions = ( '001' => \&_rpl_welcome, '005' => \&_rpl_isupport, '332' => \&_rpl_topic, '333' => \&_rpl_topicdetails, '352' => \&_rpl_whoreply, '353' => \&_rpl_namreply, 'JOIN' => \&_msg_join, 'PART' => \&_msg_part, 'KICK' => \&_msg_part, 'MODE' => \&_msg_mode, 'QUIT' => \&_msg_quit, ); sub process { my($self, $line) = @_; my @text = split(/\s/, $line); if($actions{$text[1]}) { return(&{$actions{$text[1]}}($self, $line, @text)); } }