#!/usr/bin/perl -w use strict; my $file = 'C:\temp\index.html'; display_browser("$file"); ##subroutine that supposedly displays a file in IE browser window sub display_browser { my $file = shift; ## convert backslashes to forward slashes in the file path $file =~ s!\\!/!g; if ( $^O eq "MSWin32" and "$file" and -e "$file" ) { use Win32::OLE; ## test to see if internet explorer is already running my $ie = Win32::OLE->GetActiveObject('InternetExplorer.Application'); ## if ie is not running, launch it, yeah right! unless ( defined $ie ) { $ie = new Win32::OLE( 'InternetExplorer.Application', '' ) or die "Yikes, can't launch Internet Explorer: $!"; } ## if we were successful in launching, make visible and navigate to the proper URL if ( defined $ie ) { $ie->{Visible} = 1; $ie->Navigate("$file"); } } }