in reply to Re: convert longIP to stringIP
in thread convert longIP to stringIP

Juerd,
Thanks...however my long number is negative and it doesnt seem to work?
My number is -1675066731. Any ideas?

Replies are listed 'Best First'.
Re: Re: Re: convert longIP to stringIP
by Mr. Muskrat (Canon) on Sep 12, 2003 at 19:02 UTC

    Try this:

    use Socket qw(inet_aton inet_ntoa); my $num = -1675066731; print inet_ntoa(inet_aton(hex(sprintf "%x", $num))); __DATA__ 156.40.130.149