perl - Net::Whois::Raw not stripping whois disclaimers -


i'm trying write perl script displays whois information various servers. whois servers, return types of disclaimers , other text within replies. net::whois::raw have options strip these disclaimers, can't work.

here's how tried it:

#!/usr/bin/perl use strict; use warnings;  $omit_msg = 2; $check_fail = 2; $use_cnames = 1;  use net::whois::raw qw(whois $omit_msg $check_fail $use_cnames);  die "incorrect arguments\n" unless (@argv);  (my $i = 0; $i < @argv; $i++) {     print "\nwhois info : " . $argv[$i] . "\n\n\n";      eval     {         $whoisinfo = whois($argv[$i]);         print $whoisinfo;     };     if ($@)     {         print "error while retrieving whois details.";     }     print "\n"; } 

i'm sorry if dumb question, can point out i'm doing wrong here?

thanks in advance.

may not looking for, i'm doing work parsing raw whois database files (which can download in complete form, ftp://ftp.ripe.net/ in 'ripe/database' directory)

like wanted filter out disclaimers, have different needs, fact i'm preprocessing files before feeding them database script inserted database.

anyway, i'm using following command line pre filter plain text database files:

cat ripe.db.as-block | grep -v '^\s*#' | grep -v '^remarks:\s*\*' 

i guess following that, pipe output perl script, or write new file using > operator, process new file perl script.

this work on windows using gnuwin32 toolset sourceforge, gives windows compatible command line binaries mirror linux counter parts, need tweak quotes, ' "

as example of strips:

this....

# # contents of file subject # ripe database terms , conditions # # http://www.ripe.net/db/support/db-terms-conditions.pdf #  as-block:       as1877 - as1901 descr:          ripe ncc asn block remarks:        these numbers further assigned network remarks:        operators in ripe ncc service region. remarks:        assignment policy documented in: remarks:        <http://www.ripe.net/ripe/docs/asn-assignment.html> remarks:        ripe ncc members can request numbers using remarks:        form available in lir portal or at: remarks:        <http://www.ripe.net/ripe/docs/asnrequestform.html> org:            org-ncc1-ripe admin-c:        dumy-ripe tech-c:         dumy-ripe mnt-by:         ripe-dbm-mnt mnt-lower:      ripe-ncc-hm-mnt changed:        unread@ripe.net 20000101 source:         ripe remarks:        **************************** remarks:        * object modified remarks:        * please note data regarded personal remarks:        * data has been removed object. remarks:        * view original object, please query ripe database at: remarks:        * http://www.ripe.net/whois remarks:        **************************** 

ends this:

as-block:       as1877 - as1901 descr:          ripe ncc asn block remarks:        these numbers further assigned network remarks:        operators in ripe ncc service region. remarks:        assignment policy documented in: remarks:        <http://www.ripe.net/ripe/docs/asn-assignment.html> remarks:        ripe ncc members can request numbers using remarks:        form available in lir portal or at: remarks:        <http://www.ripe.net/ripe/docs/asnrequestform.html> org:            org-ncc1-ripe admin-c:        dumy-ripe tech-c:         dumy-ripe mnt-by:         ripe-dbm-mnt mnt-lower:      ripe-ncc-hm-mnt changed:        unread@ripe.net 20000101 source:         ripe 

the trick filtering using reverse grep that's '-v' in command line, says let every line pass except match pattern, opposed it's normal invocation, it's used select wanted lines.

if have criteria want filter out before processing, need pipe more inverted grep commands onto end using pipe character.


Comments