#!/usr/bin/perl -w OUTER: while (<>){ s/^\s+//; # trim off whitespace... next OUTER if /^$/; # ignore blank lines chomp; $registrant=$_ if (/Registrant:/../\)/); $domain_name=$_ if /Domain Name.*/; $admin=$_ if /Administrative Contact:/../\)/; $tech=$_ if /Technical Contact:/../\)/; $billing=$_ if /Billing Contact:/../\)/; $expires=$_ if /Record expires on .*/; if (/NAME\..+\s+\d{1,3}.\d{1,3}.\d{1,3}/){ s/Name Server: .*//; push @names, $_; next OUTER; } write STDOUT if defined($registrant and $admin and $tech and $billing and $names[2] and $expires); } format STDOUT = ================================================================================ @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Registrant: @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< $domain_name , $registrant Admin: @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< $admin Tech: @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< $tech Billing: @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< $billing DNS: @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< $names[0] @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< $names[1] @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< $names[2]@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< $expires ================================================================================ .