<[EMAIL PROTECTED]> asked: > I need to convert the first column of a list of IP numbers to > IP addresses. I created an array of my list but am stumped > on how to convert the numbers.
#!/usr/bin/perl use strict; use warnings; use Socket; sub number_to_ip { return( inet_ntoa( pack( 'N', $_[0] ) ) ); } while( <DATA> ){ my( $number, $hostname ) = split; print $hostname . " => " . number_to_ip( $number ) . "\n"; } __DATA__ 180884576 imstrmcs05 180884577 imstrmcs06 180884578 imstrmcs07 180884579 imstrmcs08 180884580 imstrmcs09 180884581 imstrmcs10 HTH, Thomas -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>