Take two seconds to think what you want to check. All the nics have a device, so that's obviously not it.
for my $nic (networkInfo()) { if (defined($nic->{ip}) { print "DeviceMain: $nic->{device} " . "has IP Address $nic->{ip}\n" . "\tMask: $nic->{mask}\n" . "\tBroadcast: $nic->{bcast}\n"; } if (defined($nic->{ip6}) { print "DeviceMain: $nic->{device} " . "has IPv6 address $nic->{ip6}\n"; } }
(Made the lines shorter to avoid PM's wrapping.)
In reply to Re: Need help with small IF statement
by ikegami
in thread Need help with small IF statement
by MikeDexter
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |