sunadmn has asked for the wisdom of the Perl Monks concerning the following question:
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
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;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Automating whois??
by tcf22 (Priest) on Nov 10, 2003 at 19:35 UTC | |
by sunadmn (Curate) on Nov 10, 2003 at 19:42 UTC | |
by iburrell (Chaplain) on Nov 10, 2003 at 21:49 UTC | |
Re: Automating whois??
by shockme (Chaplain) on Nov 10, 2003 at 20:27 UTC | |
by sunadmn (Curate) on Nov 10, 2003 at 21:08 UTC | |
by Anonymous Monk on Nov 10, 2003 at 22:55 UTC | |
Re: Automating whois??
by ehdonhon (Curate) on Nov 10, 2003 at 22:57 UTC |
Back to
Seekers of Perl Wisdom