in reply to Re: Re: gethostbyname not working
in thread gethostbyname not working

This is what I did at first, that was the problem (if you look at my original post). what's the difference?

Replies are listed 'Best First'.
Re: Re: Re: Re: gethostbyname not working
by Anonymous Monk on Mar 27, 2001 at 04:35 UTC
    You weren't unpacking the address.
Re: Re: Re: Re: gethostbyname not working
by Clownburner (Monk) on Mar 27, 2001 at 20:35 UTC
    You still need to unpack the results.

    A complete example would be:

    my $hostname = 'yahoo.com'; my $addr = gethostbyname($hostname); my ($a,$b,$c,$d) = unpack('C4',$addr); print "$a.$b.$c.$d\n";

    Signature void where prohibited by law.