It is a reference to an array, so you have to dereference it:
my @ipaddrs = @{$adapter->{'IPAddress'}};
foreach my $ipaddr (@ipaddrs) { ... }
If, like me, you do not care for the @{} syntax, you could write:
my $ipaddrs = $adapter->{'IPAddress'};
foreach my $ipaddr (@$ipaddrs) { ... }
- Pat
Eric Hennessey <[EMAIL PROTECTED]> writes:
> I'm using WMI calls to enumerate network adapters and display them. In the
> WMI docs, the property IPAddress is an array value in
> Win32_NetWorkAdapterConfiguration.
>
> So why does the following produce ARRAY(0xsomehexvalue) for its output?
>
> my @ipaddrs = $adapter->{'IPAddress'};
> .
> .
> .
> foreach my $ipaddr (@ipaddrs) {
> print "$ipaddr\n";
> }
>
>
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs