Skip Menu |

This queue is for tickets about the Net-DNS CPAN distribution.

Report information
The Basics
Id: 34407
Status: resolved
Priority: 0/
Queue: Net-DNS

People
Owner: Nobody in particular
Requestors: richard_a_brunner [...] yahoo.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Net-DNS-0.63 I must be doing something wrong but I can't figure it out. When I run the below program and select to do $answer->string, I see that the array pointed to by $answer has at least 1 entry and that entry points to a hash with a ptrdname key and all is good. If I do not, then answer points to an empty array and I don't get the resolution. I'm wondering if it is a timing issue? I don't know if this is a bug or if I am making a mistake. Program output: =============== Z:\> perl reverse-ip.pl 4.2.2.2 n No ptrdname defined Z:\> perl reverse-ip.pl 4.2.2.2 y PTR Name: vnsc-bak.sys.gtei.net Program: ======== #!/usr/bin/perl use strict; use warnings; use Net::DNS; my $res = Net::DNS::Resolver->new(nameservers=>['208.67.222.222']); my $answer = $res->search( shift(@ARGV) ); my $duh = $answer->string if (shift(@ARGV) =~ /y/); my $name = $answer->{answer}[0]->{ptrdname}; if (defined $name ){ print "PTR Name: ".$name."\n";} else { print "No ptrdname defined\n";} Version Info, etc ... ===================== Z:\> perl -v This is perl, v5.8.8 built for MSWin32-x86-multi-thread (with 18 registered patches, see perl -V for more detail) Copyright 1987-2007, Larry Wall Binary build 822 [280952] provided by ActiveState http://www.ActiveState.com Built Jul 31 2007 19:34:48 Z:\> perl -V Set up gcc environment - 3.4.4 (cygming special) (gdc 0.12, using dmd 0.125) Summary of my perl5 (revision 5 version 8 subversion 8) configuration: Platform: osname=MSWin32, osvers=5.00, archname=MSWin32-x86-multi-thread uname='' config_args='undef' hint=recommended, useposix=true, d_sigaction=undef usethreads=define use5005threads=undef useithreads=define usemultiplicity=de fine useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='gcc', ccflags ='-DNDEBUG -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYP T -DNO_HASH_SEED -DUSE_SITECUSTOMIZE -DPRIVLIB_LAST_IN_INC -DPERL_IMPLICIT_CONTE XT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX -DHASATTRIBUTE -fno-st rict-aliasing', optimize='-O2', cppflags='-DWIN32' ccversion='', gccversion='3.4.4 (cygming special) (gdc 0.12, using dmd 0.125 )', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=8 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='__int64', lseeksi ze=8 alignbytes=8, prototype=define Linker and Libraries: ld='g++', ldflags ='-L"z:\bin\apps\perl\lib\CORE"' libpth=\lib libs=-lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 - lodbccp32 -lmsvcrt perllibs=-lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshel l32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc 32 -lodbccp32 -lmsvcrt libc=msvcrt.lib, so=dll, useshrplib=true, libperl=perl58.lib gnulibc_version='' Dynamic Linking: dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags='-mdll -L"z:\bin\apps\perl\lib\CORE"' Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY PERL_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS PERL_MALLOC_WRAP PL_OP_SLAB_ALLOC USE_ITHREADS USE_LARGE_FILES USE_PERLIO USE_SITECUSTOMIZE Locally applied patches: ActivePerl Build 822 [280952] Iin_load_module moved for compatibility with build 806 PerlEx support in CGI::Carp Less verbose ExtUtils::Install and Pod::Find Patch for CAN-2005-0448 from Debian with modifications Rearrange @INC so that 'site' is searched before 'perl' Partly reverted 24733 to preserve binary compatibility MAINT31223 plus additional changes 31490 Problem bootstraping Win32CORE 31324 Fix DynaLoader::dl_findfile() to locate .so files again 31214 Win32::GetLastError fails when first called 31211 Restore Windows NT support 31188 Problem killing a pseudo-forked child on Win32 29732 ANSIfy the PATH environment variable on Windows 27527,29868 win32_async_check() can loop indefinitely 26970 Make Passive mode the default for Net::FTP 26379 Fix alarm() for Windows 2003 24699 ICMP_UNREACHABLE handling in Net::Ping Built under MSWin32 Compiled at Jul 31 2007 19:34:48 @INC: z:/bin/apps/perl/site/lib z:/bin/apps/perl/lib . Windows XP SP2
Subject: Re: [rt.cpan.org #34407]
Date: Tue, 25 Mar 2008 11:59:17 +0100
To: bug-Net-DNS [...] rt.cpan.org
From: Olaf Kolkman <olaf [...] dacht.net>
Show quoted text
> > > I don't know if this is a bug or if I am making a mistake. > > my $name = $answer->{answer}[0]->{ptrdname};
Try using the methods. $answer->answer() returns an array with RR types. So ($answer->answer())[0] is the first element. so $name = ($answer->answer())[0]->ptrdname() returns the ptr name (if the type is PTR off course). --Olaf
Download PGP.sig
application/pgp-signature 235b

Message body not shown because it is not plain text.

From: richard_a_brunner [...] yahoo.com
On Tue Mar 25 07:00:00 2008, olaf@dacht.net wrote: Show quoted text
> > I don't know if this is a bug or if I am making a mistake. > > > > my $name = $answer->{answer}[0]->{ptrdname};
Show quoted text
> Try using the methods. > > $answer->answer() returns an array with RR types.
Show quoted text
> ($answer->answer())[0] is the first element.
Show quoted text
> $name = ($answer->answer())[0]->ptrdname() > > returns the ptr name (if the type is PTR off course).
This works! Not sure why it does based on the documentation, but, I am new to using this module. Thanks!