else
cat
fi
- ) | perl -MSocket -pe 's/(\b)(\d+(?:\.\d+){3})(\b)/$1.gethostbyaddr(inet_aton($2),AF_INET).$3/ge;'
+ ) | perl -MSocket -pe 'BEGIN{sub ip2host{$i=shift;return $c{$i} if $c{$i};$h=gethostbyaddr(inet_aton($i),AF_INET);%c=()if keys(%c)>10000;return $c{$i}=$h?$h:$i;};}; s/(\b)(\d+(?:\.\d+){3})(\b)/$1.ip2host($2).$3/ge'
}
mask2cdr ()
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
-This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-
See <http://www.gnu.org/licenses/>.";
$Config::user->{$_} = \%h;