<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">#!/usr/bin/perl
# By Michael Kennedy, michael@toronto.com
# Use or modify as you wish, but no warranty.
while (&lt;&gt;) {
  if (/(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/) {
    if ($1 &lt;= 255 &amp;&amp; $2 &lt;= 255 &amp;&amp; $3 &lt;= 255 &amp;&amp; $4 &lt;= 255) {
      $txtip = "$1.$2.$3.$4";
      $ip = pack 'C4',$1,$2,$3,$4;
      $hostname = (gethostbyaddr($ip,2));
      $_ =~ s/$txtip/$hostname/ if ($hostname ne "");
    }
  }
  print;
}
</pre></body></html>