<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: internet code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Thu, 21 Aug 2008 01:32:40 GMT</pubDate>
    <description>DZone Snippets: internet code</description>
    <item>
      <title>Server name/IP converter</title>
      <link>http://snippets.dzone.com/posts/show/4246</link>
      <description>When passed either an IPv4 address or the name of a domain or server, this script will return either a name or an IP, respectively.&lt;br /&gt;&lt;code&gt;&lt;br /&gt;#!/usr/bin/perl -w&lt;br /&gt;use strict;&lt;br /&gt;use Socket;&lt;br /&gt;my $arg = shift;&lt;br /&gt;if ($arg =~ /^(\d+\.){3}\d+$/) {&lt;br /&gt; print scalar gethostbyaddr(inet_aton($arg), AF_INET), "\n"&lt;br /&gt;} else { printf "%vd\n", scalar gethostbyname $arg }&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Thu, 05 Jul 2007 02:24:29 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/4246</guid>
      <author>Minimiscience (Guildorn Tanaleth)</author>
    </item>
  </channel>
</rss>
