little samie

Index   Next   Previous

use Win32::OLE;
use Win32::SAM;
#use Win32::Slingshot;

$| = 1;
my $URL = "http://www.google.com/";
my $seconds;

$Win32::OLE::Warn = 3;

StartIE();
$seconds = Navigate($URL);
print "Google Page took $seconds seconds to load\n";
SetEditBox("q","Presidents");
$seconds = ClickFormButton("btnG");
print "Query Page took $seconds seconds to load\n";


Going through the code line by line...

StartIE();

This the first line of code that makes a subroutine call to Win32::SAM.pm.  The StartIE subroutine is defined in SAM.pm which lives here:

c:\perl\site\lib\win32\SAM.pm

It is defined there like this:

sub StartIE {
    my $hnd;
    #$IE = Win32::OLE->new("InternetExplorer.Application","Quit") || die "Could not start Internet Explorer.Application\n";
    $IE = Win32::OLE->new("InternetExplorer.Application") || die "Could not start Internet Explorer.Application\n";
    Win32::OLE->WithEvents($IE,\&Event,"DWebBrowserEvents2");
    $IE->{left} = 0;
    $IE->{top} = 0;
    $IE->{height} = 700;
    $IE->{width} = 1000;
    $IE->{menubar} = 1;
    $IE->{toolbar} = 1;
    $IE->{statusbar} = 1;
    $IE->{visible} = 1;
    $hnd = $IE->{HWND};
    Win32::GUI::Maximize($hnd);
}

To make a long story short, this subroutine

Index   Next   Previous

little samie