The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Net::Whois::Parser - module for parsing whois information

SYNOPSIS

    use Net::Whois::Parser;
    
    my $info = parse_whois( domain => $domain );
    my $info = parse_whois( raw => $whois_raw_text, domain => $domain  );
    my $info = parse_whois( raw => $whois_raw_text, server => $whois_server  );
    
    $info = {
        nameservers => [
            { domain => 'ns.example.com', ip => '123.123.123.123' },
            { domain => 'ns.example.com' },
        ],
        emails => [ 'admin@example.com' ],
        domain => 'example.com',
        somefield1 => 'value',
        somefield2 => [ 'value', 'value2' ],
        ...
    };
    
    # Your own parsers
    
    sub my_parser {
        my ( $text ) = @_;
        return {
            nameservers => [
                { domain => 'ns.example.com', ip => '123.123.123.123' },
                { domain => 'ns.example.com' },
            ],
            emails => [ 'admin@example.com' ],
            somefield => 'value',
            somefield2 => [ 'value', 'value2' ],
        };                    
    }
    
    $Net::Whois::Parser::PARSERS{'whois.example.com'} = \&my_parser;
    $Net::Whois::Parser::PARSERS{'DEFAULT'}           = \&my_default_parser;
    
    
    # If you want to convert some field name to another:
        
    $Net::Whois::Parser::FIELD_NAME_CONV{'Domain name'} = 'domain';
    

DESCRIPTION

Net::Whois::Parser module provides Whois data parsing. You can add your own parsers for any whois server.

FUNCTIONS

parse_whois(%args)

Returns hash of whois data. Arguments:

'domain' - domain

'raw' - raw whois text

'server' - whois server

'which_whois' - option for Net::Whois::Raw::whois. Default value is QRY_ALL

CHANGES

See file "Changes" in the distribution

AUTHOR

Ivan Sokolov, <ivsokolov@cpan.org>

COPYRIGHT & LICENSE

Copyright 2009 Ivan Sokolov

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.