|
From: x on 31 Oct 2005 18:47 I'm trying to get Perl 5.8.7 working on z/OS. This nearly works but... for some reason the inet_aton and gethostbyname calls are returning undef. I guess that this means that I have to get involved in debugging the internals. Does anyone know what C files lie at the heart of these routines and what the best way to go about patching them is? Ross
From: Purl Gurl on 31 Oct 2005 19:21 x(a)y.com wrote: > I'm trying to get Perl 5.8.7 working on z/OS. This nearly works but... > for some reason the inet_aton and gethostbyname calls are returning undef. "nearly works" Please expand on your thought. You need to provide your code in use. Purl Gurl
From: x on 31 Oct 2005 19:56 Purl Gurl wrote: > x(a)y.com wrote: > >> I'm trying to get Perl 5.8.7 working on z/OS. This nearly works but... >> for some reason the inet_aton and gethostbyname calls are returning >> undef. > > > "nearly works" Please expand on your thought. > > You need to provide your code in use. > > Purl Gurl > By "nearly works" I meant that it passes most of the "make test" tests, except for those related to unicode, which does not work on z/OS. Here is a test script for gethostbyname: use English; use Socket; use strict; my ($host, $aliases, $addrtype, $length, @addrs) = gethostbyname ('ssa97.worldgroup.com'); print $host, "\n"; my ($a, $b, $c, $d) = unpack ('C4', $addrs[0]); printf ("%d.%d.%d.%d\n", $a, $b, $c, $d); exit 0; Here is the correct output, from Perl 5.6.1: ssa97.worldgroup.com 203.2.203.197 Here is what I get from Perl 5.8.7: 0.0.0.0 NB: Contrary to my original posrt, inet_aton is working OK.
From: Purl Gurl on 31 Oct 2005 20:17 x(a)y.com wrote: > Purl Gurl wrote: >> x(a)y.com wrote: (snipped) > use English; > use Socket; > use strict; > my ($host, $aliases, $addrtype, $length, @addrs) = gethostbyname > ('ssa97.worldgroup.com'); (snipped) > Here is the correct output, from Perl 5.6.1: > ssa97.worldgroup.com > 203.2.203.197 > Here is what I get from Perl 5.8.7: > 0.0.0.0 Uh huh. Not surprising. Perl porters broke lots of code out there adding unwarranted whistles and bells to perl. Try this, forwards or backwards: #!perl use Socket; @Array = qw (google.com purlgurl.net); foreach $host (@Array) { $ip_address = inet_ntoa (inet_aton($host)); print "$host : $ip_address\n"; $hostname = gethostbyaddr (inet_aton ($ip_address), AF_INET); print "$ip_address : $hostname\n"; } exit; PRINTED RESULTS: google.com : 216.239.37.99 216.239.37.99 : google.com purlgurl.net : 66.215.191.86 66.215.191.86 : purlgurl.net Purl Gurl
From: x on 1 Nov 2005 18:08 Purl Gurl wrote: > x(a)y.com wrote: >> Purl Gurl wrote: >>> x(a)y.com wrote: >> use Socket; >> use strict; > >> my ($host, $aliases, $addrtype, $length, @addrs) = gethostbyname >> ('ssa97.worldgroup.com'); > >> Here is the correct output, from Perl 5.6.1: >> ssa97.worldgroup.com >> 203.2.203.197 > > >> Here is what I get from Perl 5.8.7: >> 0.0.0.0 > > > Uh huh. Not surprising. Perl porters broke lots of code > out there adding unwarranted whistles and bells to perl. I couldn't possibly draw such a conclusion. I just have a problem with gethostbyname on one platform. I know that the same call works on other platforms. > Try this, forwards or backwards: > > #!perl > > use Socket; > > @Array = qw (google.com purlgurl.net); > > foreach $host (@Array) > { > $ip_address = inet_ntoa (inet_aton($host)); > print "$host : $ip_address\n"; > > $hostname = gethostbyaddr (inet_aton ($ip_address), AF_INET); > print "$ip_address : $hostname\n"; > } > > exit; inet_ntoa works. However, the reverse lookup works for Perl 5.6.1 but not 5.8.7 google.com : 216.239.57.99 216.239.57.99 : purlgurl.net : 66.215.191.86 66.215.191.86 :
|
Pages: 1 Prev: Timelocal input, post good Date filters (from - to) Next: s///x |