[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 23:02:15 +0200, Michael Rasmussen wrote:

> 
> 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";
> }
Glemte helt løsningen:-)

Det du sikkert er ude efter:
#!/usr/bin/perl
use Net::DNS;

my $res = Net::DNS::Resolver->new;
my $query = $res->query("w0.dk", "TXT");
if ($query) {
    foreach $rr (grep { $_->type eq 'TXT' } $query->answer) {
        my @info = $rr->char_str_list;
        while (my $txt = pop @info) {
            print $txt . "\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] *