Question:
What is the correct syntax of the VB array element
"Machine.IPAddresses(0)" in Perl?
Answer:
$IPAddressThingie = $machine->IPAddresses(0);
BTW: I am just curious...why are you using Enum->Next() instead of in()?
dave
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 14, 2001 3:58 AM
To: [EMAIL PROTECTED]
Subject: Perl syntax of VBScript variables
Hi all,
I am trying to rewrite this VBScript in Perl.
'do a query
'----------
set Machines = WbemServices.ExecQuery("select * From SMS_R_System")
For Each Machine in Machines
wscript.echo Machine.Name + ": " + Machine.IPAddresses(0)
Next
Question:
What is the correct syntax of the VB array element
"Machine.IPAddresses(0)" in Perl?
Here is a sample of my code (I am unable to get the
IP address to compile properly):
my ($Enum, $machine);
$Enum = Win32::OLE::Enum->new($objSet);
while ( defined( my $machine = $Enum->Next() ) )
{
print "Machine: ", $machine->{Name}, ", and it's IP address is:",
$machine->{$IPAddresses[0]}, "\n";
}
Thanks in advance,
FJB
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin