Wizards,

I'm doing something wrong here, but the complicated syntax is only confusing me.  Here's the code...

45 my $services = $objWMIService->ExecQuery( "Select *
46                                               From Win32_Service
47                                               Where ServiceType = '$stype'" );
48
49 for my $j (0 .. [EMAIL PROTECTED]) {
50    push( @ary, @{$services}[$j]->DisplayName );
51 }

$services is the return from the ExecQuery call, and I'm trying to slap the DisplayName properties from it into an array. The syntax error "Not an ARRAY reference" pops up at the for loop line (line #49). As you can no doubt tell from the plethora of gobbledegook surrounding the terminal value, I'm (again) in over my pointy little head. Can someone help me straighten out the slapdash, throw-stuff-at-it-til-it-works, mess I've made of things?

I've got a working version, using the in operator, but this is the only code in a largish module that uses it, so if I can straighten this out, then I don't need to "use" in, and I can decrease the code's footprint.

Thanks!

Deane
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to