foreach $server ( @servers ) { if( $found == 0 ) { if( -e "\\\\$server\\C\$\\" ) { print "\n\nServer is already linked\n\n"; find( \&finddata, "\\\\$server\\c\$\\VoiceGenie\\mp\\logs\\" )or warn "Could not enter the specified path \\\\$server\\c\$\\VoiceGenie\\mp\\logs\\.\n"; #Function that allows the use of File::Find. } else { print "\n\nServer not linked connecting now\n\n"; qx|net use \\\\$server\\C\$\\VoiceGenie\\mp\\log $ServerPassword /user:$username|; find( \&finddata, "\\\\$server\\c\$\\VoiceGenie\\mp\\logs\\" ) or warn "Could not enter the specified path \\\\$server\\c\$\\VoiceGenie\\mp\\logs\\.\n"; #Function that allows the use of File::Find. qx|net use \\\\$server\\C\$\\VoiceGenie\\mp\\log /D|; } } }