🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.perl
Article #255

gethostbyaddr()

#255
From: Alan Ghafour
Date: Thu, 15 May 1997 09:01
31 lines
1495 bytes
Probuje zrobic gethostbyaddr() i za ... mi nie wychodzi :-(
Moze ktos przesledzi ponizszy kawalek i powie gdzie jest blad ?

#! /usr/bin/perl

$host="pingwin.ds2.pg.gda.pl";
$addr="153.19.170.112";

#############################################
# Resolving na podstawie nazwy dziala poprawnie !

($a,$b,$c,$d)=unpack("C4",gethostbyname($host));
$IP=join(".",$a,$b,$c,$d);
print $host,"\n", $IP, "\n";

#############################################
# A na podstawie adresu nie :-(

# Ani tak ...
$name=gethostbyaddr($addr,AF_INET);
print $name, "\n";

# Ani tak
$addr=pack("C4",$a,$b,$c,$d);
$name=gethostbyaddr($addr,AF_INET);
print $name,"\n";

 __ __ __  _ _  _ ___   _  _ ___ ___   ______         Alan Ghafour 
(_  |_)|_) | |\ |  | __ |\ | |_   |   [/~~~~\]    Network Administrator
__) |  | \ | | \|  |    | \| |__  |    |_()_|     alan@gdansk.sprint.pl
                                                http://www.sprint.pl/~alan
Technical Details
Message-ID: <Pine.GSO.3.96.970515105108.18403A-100000@netra.gdansk.sprint.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!pingwin.icm.edu.pl!news.icm.edu.pl!uw.edu.pl!news.nask.pl!netra.gdansk.sprint.pl!alan

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!pingwin.icm.edu.pl!news.icm.edu.pl!uw.edu.pl!news.nask.pl!netra.gdansk.sprint.pl!alan
From: Alan Ghafour <alan@gdansk.sprint.pl>
Newsgroups: pl.comp.lang.perl
Subject: gethostbyaddr()
Date: Thu, 15 May 1997 11:01:22 +0200
Organization: Public NewsServer at NASK N.O.C.
Lines: 32
Message-ID: <Pine.GSO.3.96.970515105108.18403A-100000@netra.gdansk.sprint.pl>
NNTP-Posting-Host: red.gdansk.sprint.pl
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit