I am trying to write a VB .NET program that runs a Perl script and reads and uses the standard output. I'd like to be able to handle each line separately as it is printed, and update my program display accordingly. Here's some code I have "written" (read: "mostly copied off the internet"):

```
Private WithEvents pscript As Process

Private Sub myProgram_Load(sender As Object, e As System.EventArgs) Handles Me.Load
    pscript = New Process()
    pscript.StartInfo.CreateNoWindow = True
    pscript.StartInfo.FileName = "C:\perl64\bin\perl.exe"
    pscript.StartInfo.Arguments = "C:\test.pl"
    pscript.StartInfo.UseShellExecute = False
    pscript.StartInfo.RedirectStandardOutput = True
    pscript.StartInfo.RedirectStandardInput = True
    AddHandler pscript.OutputDataReceived, AddressOf pscript_output_process
    pscript.Start()
    pscript.BeginOutputReadLine()
End Sub

Private Sub pscript_output_process(sender As Object, e As DataReceivedEventArgs)
    MessageBox.Show(e.Data)
End Sub

```

This works with one problem: the program waits until the test script has run to completion, and then fires several OutputDataReceived events one after the other. This means that when I make it use the real script, it's likely to do nothing for as much as several hours, and then have to deal with, like, 5,000 events at once, despite the fact that stuff was being printed at fairly regular intervals throughout that time.

Is there any way I can make it deal with each line of text when it is written, instead of all of it at once at the end?