I've found that the only real way to solve this is to ask the user to make a client-side change - namely, going into their Explorer -> File Types menu and changing the option for PowerPoint files to disable the "browse in same window" choice, which is on be default AFAIK. The only other things I can think of are 1) that the $filename contains some invalid characters (perhaps whitespace or non-ASCII characters) that are confusing IE, or 2) that your script is sending multile Content-type or Content-disposition headers (or your web server is adding them). To check for this, you need to view the headers your client is actually receiving; one easy (and Perlish) way to do this is to set up a local instance of
HTTP::Proxy and point your browser to it.