You have two possible ways to go, as you already have libpcap installed:
One would be to do all capturing in Perl using Net::PCap and Net::PCapUtils - but this means that you'll have to write your captured stream to disk yourself and if you use other programs to postprocess the data, this might be undesireable.
The other way would be to find the console tethereal runs in, and send a CTRL-C to it. You have to find the console window, and finding the console window requires that you give it a unique window title (for example under Windows NT/2k/XP by launching the other process through a .cmd file which first sets the console window title). Then try SendKeys from the Win32::GuiTest package to send a ^C to it. That already might be enough, but possibly you have to send a "close-click" to the console window itself, and that is where it starts getting ugly :-)
|