[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [PROGRAMMERING] [Perl] Net::DNS - TXT record



On Wed, 08 Jun 2005 21:44:35 +0200, Hans Schou wrote:

> 
> Kender du Net::DNS og kan spotte fejlen, eller kender du et bedre modul
> til at lave TXT look-ups i DNS?
> 
Dit problem er, at "objektet" NET::DNS:RR:TXT ikke indeholder medlemmet
ndsname. Et NET::DNS::RR::TXT objekt har følgende medlemmer:
bless( {
   'rdlength' => 22,
   'ttl' => 85671,
   'name' => 'w0.dk',
   'class' => 'IN',
   'type' => 'TXT',
   'char_str_list' => ['03 2400 Koebenhavn NV'],
   'rdata' => '03 2400 Koebenhavn NV'
},
'Net::DNS::RR::TXT' )

Hvis du kommer i en lignende situation, hvor medlemmer i et objekt er
ukendt, kan det anbefales at benytte Data:Dumper:
#!/usr/bin/perl
use Net::DNS;
use Data::Dumper;

my $res = Net::DNS::Resolver->new;
my $query = $res->query("w0.dk", "TXT");
if ($query) {
    foreach $rr (grep { $_->type eq 'TXT' } $query->answer) {
    	print Dumper($rr);
        print $rr->rdata . "\n";
    }
} else {
    warn "query failed: ", $res->errorstring, "\n";
}

-- 
Hilsen/Regards
Michael Rasmussen
http://keyserver.veridis.com:11371/pks/lookup?op=get&search=0xE3E80917



 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 22:44 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *