in reply to What is the best way to pack an ip address?
Also have you tried doing this on the same machine?unpack("a4", inet_ntoa($buffer);
Do you get the correct address after doing this? If you do perhaps you are misconfiguring your setup to transmit the bytes over the socket?my $buf,$str; my $ip_addr="10.10.10.1"; $buf=pack("a4",inet_aton($ip_addr)); $str=inet_ntoa(unpack("a4",$buf)); print "$str\n";
metadoktor
"The doktor is in."
|
|---|