I may be misunderstanding you, but a .cgi script written in perl doesn't look different than any other html, asp, or php page. It just spits out html as far as the client is concerned, so you'll still be using LWP or WWW::Mechanize or whatever. You'll still need to strip out the html tags.
If you're asking how to script the actions of opening IE and clicking the file menu and so on.... Maybe look into Win32::OLE or the ActiveState Win32 mailing lists.
--
jpg