if ($event eq 'JOIN') { # indent your code. It doesn't matter if you use tabs, 2 spaces, or 4 spaces per level, with GNU or K&R or any other bracketing. Just pick a style and use it. open (PROTECTED, "$protected"); # two element open. Global file handle in use. No error checking. Unnecessary stringification. @protected = ; # You are leaving line endings on your list items. Is this what you meant to do? This probably why what you have now isn't working. close(PROTECTED); # no error checking. for $_ (@protected) { #WTF? No need to add $_ to for declaration. if ($_ eq $user[0]) { # Do you really need to override prototypes on your function called sock? &subroutine() has a specific meaning. See perlsub for more info. sock() is not very descriptive as function names go. Try something like send_message() or send_message_to_client(). &sock("PRIVMSG $tag :$user[0] Is A Protected User! $_"); # If you want to have multiline variables, use a heredoc. Otherwise construct them. Dangling lines like this is asking for trouble. } } }