I've written a multi-threaded command-line script. When running it (and it runs for several hours or more), I occasionally get "Perl Command Line Interpreter has encountered an error and needs to close" pop-ups at seemingly random places in the program. Is this a bug in Perl (I've heard that threads in Windows have bad memory management), or a bug in my code?