Function doQueryWord(aWord As String, aRole as String) As String ' Construct a command in the simple protocol wordnet-ipc expects Dim cmd as String cmd = "word" & ";" & aWord & ";" & aRole ' Send the command to the waiting perl script perlIn.writeLine cmd ' Read the output from the perl script. This will block until output appears. Dim results As String results = perlOut.readLine ' Return results. You could split on commas - not sure what format you need. doQueryWord = results End Function ' doQuerySense would be nearly identical