perl and network addresses

Paul Lussier p.lussier at comcast.net
Tue Mar 28 10:30:01 EST 2006


"Ben Scott" <dragonhawk at gmail.com> writes:

>   I tried
>
> 	perl -we '$a = inet_addr("192.0.2.42");'
>
> but it complained that inet_addr is not defined.  I suspect there's a
> module somewhere you need to pull in.  Hopefully this is enough to get
> you started.

You likely need to use -MSocket, and then figure out which of the
correct functions in there are analogous to inet_addr.  The ones which
leap to mind are inet_ntoa and inet_aton.  There doesn't seem to be an
inet_addr.
-- 

Seeya,
Paul



More information about the gnhlug-discuss mailing list