my %helpdocs = ( help => ['Use !help to list commands; !help commandname to provide command info'] ); if (exists($helpdocs{$helptopic})) { @@ foreach ($helpdocs{$helptopic}->[0..(?)]) { print $sock "PRIVMSG $helplocation :$_\n"; sleep 1; } }