Home Page   the Perl Page   Programming and Computer Reviews   and Thailand Comments

Snatch - Fun with IE5

use Win32::OLE;             snatch    dtd    GUI    subs    XML examples   

running IE5 with OLE

This is very simple stuff. Suppose you have a little javascript that says:
<SPAN id="timestr"> </span>
So later you call the file and use the built-in Snatch function innerText :
my $time=&timeDate;
Doesn't get much simpler.
(innerHTML is also available.)
So What!
So it makes a wonderful debugger. Set up an alarm and you're getting real time output of things like system variables.


module report.xml Thursday, March 23, 2000
warning: likely to have anything I'm experimenting with included
This uses alarms to illustrate the above and puts a couple of useful buttons on the page.
Reset runs it again, (making a fast edit & run cycle)
Link jumps to another file and
Eval lets you enter expressions at the console box.
The buttons change an element called Status like this:
and the code just looks at it.
if (innerText('Status') eq 'eval') { ...

Using IE5 as a User Interface

The little example about puts a lot of function in a lightweight package ... IE is not exactly Small but if its open already the overhead isn't too bad.
The model is flexible enough to:
Start Snatch and run a few things
Start the GUI
Turn off the GUI and run in the background for awhile
Start the GUI again,,,, ect.
(No, I haven't done that yet, gimme a week :-)

For some things this will be enough.
What happens when we combine this with PerlScript is a happy question.