Thx for the help. I ajusted the script a little and now I atleast have some output.
use Net::Whois::RIPE; $server = "whois.ripe.net"; $as = "LEASEWEB"; $whois = Net::Whois::RIPE->new($server); $query = $whois->query($as); $output = $query->content; @lijn = split(/\n/,$output); foreach $line (@lijn) { @lines = split(/:/, $line); next unless ($lines[0] =~ /inetnum/); $lines[1] =~ s/^\s+|\s+$//g; print $lines[1]."\n"; } exit;
It all works fine now. But there's just one more problem. I don't get all the ranges from that AS. When I type in the AS in www.ripe.net, I get way more. I'll look further. edit1:I adjusted the code a little bit more. edit2:I'll try to explain the problem that I have now with examples. This is the output from my script:
% This is the RIPE Whois query server #1. % The objects are in RPSL format. % % Rights restricted by copyright. % See http://www.ripe.net/db/copyright.html % Note: This output has been filtered. % To receive output for a database update, use the "-B" flag. % Information related to '62.212.64.0 - 62.212.64.255' inetnum: 62.212.64.0 - 62.212.64.255 netname: LEASEWEB descr: LeaseWeb descr: P.O. Box 93054 descr: 1090BB AMSTERDAM descr: Netherlands descr: www.leaseweb.com remarks: Please send email to "abuse@leaseweb.com" for complain +ts remarks: regarding portscans, DoS attacks and spam. country: NL admin-c: LSW1-RIPE tech-c: LSW1-RIPE status: ASSIGNED PA mnt-by: OCOM-MNT source: RIPE # Filtered
And this is what I get when I enter thesame AS in www.ripe.net:
% This is the RIPE Whois query server #1. % The objects are in RPSL format. % % Rights restricted by copyright. % See http://www.ripe.net/db/copyright.html % Note: This output has been filtered. % To receive output for a database update, use the "-B" flag. % Information related to '62.212.64.0 - 62.212.64.255' inetnum: 62.212.64.0 - 62.212.64.255 netname: LEASEWEB descr: LeaseWeb descr: P.O. Box 93054 descr: 1090BB AMSTERDAM descr: Netherlands descr: www.leaseweb.com remarks: Please send email to "abuse@leaseweb.com" for complai +nts remarks: regarding portscans, DoS attacks and spam. country: NL admin-c: LSW1-RIPE tech-c: LSW1-RIPE status: ASSIGNED PA "status:" definitions mnt-by: OCOM-MNT source: RIPE # Filtered person: RIP Mean address: P.O. Box 93054 address: 1090BB AMSTERDAM address: Netherlands phone: +31 20 3162880 fax-no: +31 20 3162890 abuse-mailbox: abuse@leaseweb.com nic-hdl: LSW1-RIPE mnt-by: OCOM-MNT source: RIPE # Filtered % Information related to '62.212.78.0 - 62.212.78.255' inetnum: 62.212.78.0 - 62.212.78.255 netname: LEASEWEB descr: LeaseWeb descr: P.O. Box 93054 descr: 1090BB AMSTERDAM descr: Netherlands descr: www.leaseweb.com remarks: Please send email to "abuse@leaseweb.com" for complai +nts remarks: regarding portscans, DoS attacks and spam. country: NL admin-c: LSW1-RIPE tech-c: LSW1-RIPE status: ASSIGNED PA "status:" definitions mnt-by: OCOM-MNT source: RIPE # Filtered person: RIP Mean address: P.O. Box 93054 address: 1090BB AMSTERDAM address: Netherlands phone: +31 20 3162880 fax-no: +31 20 3162890 abuse-mailbox: abuse@leaseweb.com nic-hdl: LSW1-RIPE mnt-by: OCOM-MNT source: RIPE # Filtered % Information related to '62.212.68.0 - 62.212.68.255' inetnum: 62.212.68.0 - 62.212.68.255 netname: LEASEWEB descr: LeaseWeb descr: P.O. Box 93054 descr: 1090BB AMSTERDAM descr: Netherlands descr: www.leaseweb.com remarks: Please send email to "abuse@leaseweb.com" for complai +nts remarks: regarding portscans, DoS attacks and spam. country: NL admin-c: LSW1-RIPE tech-c: LSW1-RIPE status: ASSIGNED PA "status:" definitions mnt-by: OCOM-MNT source: RIPE # Filtered person: RIP Mean address: P.O. Box 93054 address: 1090BB AMSTERDAM address: Netherlands phone: +31 20 3162880 fax-no: +31 20 3162890 abuse-mailbox: abuse@leaseweb.com nic-hdl: LSW1-RIPE mnt-by: OCOM-MNT source: RIPE # Filtered ...
So with my script I only get the first object. I need my script to get more objects, like on www.ripe.net

In reply to Re: Ripe Whois lookup by marto9
in thread Ripe Whois lookup by marto9

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.