Kak v scripte(jelatelino Perl) pod Windows uznati ip address hosta-a >
>Kak v scripte(jelatelino Perl) pod Windows uznati ip address hosta-a >use Win32::IPConfig
$ipconfig = Win32::IPConfig->new();
foreach $adapter($ipconfig->get_adapters){
@ipaddresses=$adapter->get_ipaddresses;
@ipmasks=$adapter->get_subnet_masks;
print @ipaddresses,"/",@ipmasks;
}
exit 0;P.S.
1)
C:\Perl_scripts>perl -v
This is perl, v5.8.4 built for MSWin32-x86-multi-thread
(with 3 registered patches, see perl -V for more detail)2)
C:\Perl_scripts>perl ipconfig.pl
10.196.5.186/255.255.252.0