Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Win32::OLE error in thread (ActiveSatate 5.8) on XP

Status
Not open for further replies.

MoshiachNow

IS-IT--Management
Joined
Feb 6, 2002
Messages
1,851
Location
IL
HI,

The code is :
$thr = threads->new(\&THREAD,"$computer");
sub THREAD {
use Win32::OLE qw( in with );
my $computer=shift;
$objWMIService =
Win32::OLE->GetObject("winmgmts:\\\\$computer\\root\\CIMV2") ||
&disp("WMI connection failed.\n",'RED');
$colItems = $objWMIService->ExecQuery("SELECT * FROM Win32_Product", "WQL",
wbemFlagReturnImmediately | wbemFlagForwardOnly);
}
$thr->join();

The error is :


Win32::OLE(0.1703) error 0x800401e4: "Invalid syntax"
after character 0 in "winmgmts:\\26842CILXP\root\CIMV2" at D:\DOcuments\Ripro\AIX\myscripts\pod_check.pl line 977
eval {...} called at
D:\DOcuments\Ripro\AIX\myscripts\pod_check.pl line 977
main::THREAD('26842CILXP') called at
D:\DOcuments\Ripro\AIX\myscripts\pod_check.pl
line 973 eval {...} called at
D:\DOcuments\Ripro\AIX\myscripts\pod_check.pl line 973 (#12)
Win32::OLE(0.1703) error 0x800401e4: "Invalid syntax"

Appreciate ideas.
Thanks




Long live king Moshiach !
 
You might also want to note that some modules are not thread-friendly. On some tutorial pages for programming modules (or maybe it was on a threads page I read somewhere) it'll say that some modules aren't threadable. Win32::OLE may be one of them.

-------------
Kirsle.net | Kirsle's Programs and Projects
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top