little samie

Index   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...

print "Query Page took $seconds seconds to load\n";

This code prints to standard out (the computer screen from the command line) the string - Query Page took n seconds to load. Where n is the number of seconds it took the Google Page to load.

Remember that this scalar was assigned to the number of seconds the page took to load by what was returned from the ClickFormButton subroutine.

Perl "concatenates"  (strings together) the text and the scalar $seconds and prints the sentence to the screen.

The \n at the end of the sentence tells the PERL interpreter to add a carriage return - line feed to the end of the sentence.

That's it.  We have pretty much thoroughly dissected your first samie script.

Index   Previous

little samie