Submitted By: Brian Bernard

Perl script that launches Internet Explorer, open to the Web page specified in the variable $URL.

Visual Basic
Edit|Remove
#_____________________________________________________________________
#
# A simple Perl script to launch IE with the page specified in $URL.
#_____________________________________________________________________


use Win32::OLE qw(EVENTS);
my $URL = "http://www.microsoft.com";
my $IE  = Win32::OLE->new("InternetExplorer.Application")
    || die "Could not start Internet Explorer.Application\n";
Win32::OLE->WithEvents($IE,\&Event,"DWebBrowserEvents2");

$IE->{visible} = 1;

$IE->Navigate($URL);

sub Event {
    my ($Obj,$Event,@Args) = @_;
    print "Here is the Event: $Event\n";
    if ($Event eq "DocumentComplete") {
        $IEObject = shift @Args;
        print "Here is my reference: $IEObject\n";
        print "URL: " .  $IEObject->Document->URL . "\n";
         
    }
}