Appendix F. The Two-Minute VBScript-to-Perl Tutorial
Heresy to talk about VBScript in a book largely focused on Perl tools? Perhaps, but if you put down the pitchfork for a second, I’ll explain why it is useful to spend two minutes learning a little VBScript. The following rationale assumes you have some familiarity with machines running Windows-based operating systems. If you’ve never had any contact with Windows machines, and never expect to, please skip to the next appendix. The rest of you, follow me.
It may border on the tautological to say this, but Microsoft expects administrators to
automate their tasks using Microsoft technologies. Perl has been shoehorned into this
realm largely thanks to the efforts of Jan Dubois and the other contributors to the
Win32::OLE module. This module gives us a way to
communicate with other parts of the Microsoft software universe on an almost equal
footing with Microsoft scripting languages like VBScript.
Win32::OLE makes communication possible, but it
doesn’t always make it easy. Perl doesn’t share the same DWMM (Do What Microsoft Means)
language idioms as VBScript, so it’s not always clear how an apparently simple piece of
VBScript code that performs some behind-the-scenes magic for the programmer can be
translated. This difficulty is compounded by the lack of reference and teaching material
written in our native language. Barring a few notable exceptions, like David Roth’s books, the vast majority of the material on Windows scripting is written ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access