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;

In reply to Automating whois?? by sunadmn

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.