Aug 10, 2009, 10:46 PM
Post #1 of 3
Please help to solve my problem
i wrote a perl script to get the ip informaion of the interface in my server.
Its working, but i only interest about the network address and its CIDR noration prefix.
this my code for your refernce.
@filter=qx|$command |or die("Can't get info from ifconfig: ".$!);
# print "$1\t";
# print "$1\n";
@CIDR=`/sbin/ipcalc-copy $para1 $para2| grep 'Network: '`;
this is working fine, its give me the result as ;
Network: 192.168.0.0/28 11000000.10101000.00000000.0000 0000
But i need only the Decemial format, i dont need the binary format, can anybody help me to filter the 192.168.0.0/28 from above result.