

$bin_addr = gethostbyname($host);
$addr = sprintf("%vd", $bin_addr);
(via http://code.nanigac.com/source/view/381)
#!/usr/bin/perl
use strict;
use warnings;
use Net::Ping;
my $host = shift @ARGV;
my $p = Net::Ping->new();
my ($ret, $duration, $ip) = $p->ping($host, 1);
$p->close();
if ($ret) {
print "$host : $ip\n";
}
% ./netping.pl chalow.net chalow.net : 219.94.129.235 % ./netping.pl twitter.com twitter.com : 128.242.240.116 % ./netping.pl bit.ly bit.ly : 128.121.234.46


本書のテーマは,Webサービスの実践的な設計です。まずHTTPやURI,HTMLなどの仕様を歴史や設計思想を織り交ぜて解説します。そしてWeb サービスにおける設計課題,たとえば望ましいURI,HTTPメソッドの使い分け,クライアントとサーバの役割分担,設計プロセスなどについて,現時点のベストプラクティスを紹介します。