If it breaks, you get both halves...

Todd Caine todd_caine at eli.net
Wed Feb 20 17:02:38 CST 2002


Doesn't this seem like strange behavior?

perl -MSocket -e 'print
inet_ntoa(gethostbyname("www.eli.net"))'

prints:

Usage:  Socket::inet_ntoa(ip_address_sv) at -e line 1

but....

perl -MSocket -e 'print
inet_ntoa("".gethostbyname("www.eli.net"))'

does the right thing and prints the IP address in dotted
decimal notation.

Seems like a kludge to me.  Shouldn't gethostbyname() return
a scalar and inet_ntoa() accept one?  I know Socket.pm is
basically a Perl wrapper but other XS modules seem to
convert their arguments and return values appropriately.

Foo!
Todd

TIMTOWTDI



More information about the Pdx-pm-list mailing list