Good afternoon fellow monks. I have been given a task of spliting my current company and old sister companies DNS. Now I have been able to make a list of company and sister company owned domains names and have a script that will perform a whois on either list, but what I would like to be able to do is grab the STDOUT from the command I run and sort each instance of the whois info for certain name servers and then from that store the domain name that the whois was ran on into theree different files (i.e. ours. theirs, and unknown ). This is where I am getting a bit confused. I have thought of using arrays to do this, but my list is large and I dont want to eat memory since this will be run on a production box. With that said can anyone point me in the best direction to do this?? Below is the current code I have to run the whois on the list I have.
Thanks all
-sunadmn
USE PERL
#!/usr/bin/perl -w
# This script will run a whois on a list of domains names
use strict;
my $domains = '/var/tmp/clean';
my $cmd = '/usr/local/libtpp-1.32.02.redhat6/bin/tpp -c /usr/loca
+l/libtpp-1.32.02.redhat6/bin/tpp.db -whois';
my $out = '/var/tmp/out_put';
open(OUT, ">$out") || die "Cant creat $out\nReason: $!\n";
open(IN, "$domains") || die "Cant open $domains to read\nReason: $!\n
+";
my @domain = <IN>;
close(IN);
foreach my $line (@domain) {
chomp $line;
print "running whois on $line\n";
system "$cmd $line";
}
close(OUT);
exit;