#!c:/sw/perl/bin/perl.exe
use warnings;
use strict;
use Win32::OLE;
our $project;
sub OLECheck (&$) {
my ($sub,$msg) = @_;
my $result = eval &$sub;
die "Couldn't $msg: $@" if $@;
my $error = Win32::OLE->LastError();
die "Couldn't $msg: $error" if $error;
$result;
}
OLECheck {$project = Win32::OLE->new("ISWiAutomation9.ISWiProject");}
"instantiate the Developer Automation Interface";
print "success!\n";
####
Couldn't instantiate the Developer Automation Interface: Can't modify constant item in scalar assignment at (eval 2) line 2, at EOF
Bareword "Win32::OLE" not allowed while "strict subs" in use at (eval 2) line 1.
####
my $result = eval {$sub->()};