turbo3k has asked for the wisdom of the Perl Monks concerning the following question:
I can then execute another query to reverse the process:mysql> SELECT INET_ATON('192.168.1.100'); +----------------------------+ | INET_ATON('192.168.1.100') | +----------------------------+ | 3232235876 | +----------------------------+ 1 row in set (0.00 sec)
How would I duplicate this process in Perl? There is an ‘inet_aton’ operator in Perl but it does not return a decimal number as shown above. I would like the ability to print this number out to the screen.mysql> SELECT INET_NTOA('3232235876'); +-------------------------+ | INET_NTOA('3232235876') | +-------------------------+ | 192.168.1.100 | +-------------------------+ 1 row in set (0.00 sec)
Thanks in advance for any help.#!/usr/bin/perl -w use strict; use Socket; my $string = inet_aton("204.87.241.1"); print "$string\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: INET_NTOA Equivalent
by saintmike (Vicar) on Apr 14, 2004 at 22:27 UTC | |
|
Re: INET_NTOA Equivalent
by esskar (Deacon) on Apr 14, 2004 at 22:28 UTC | |
|
Re: INET_NTOA Equivalent
by NetWallah (Canon) on Apr 14, 2004 at 23:58 UTC | |
by atcroft (Abbot) on Apr 15, 2004 at 02:53 UTC | |
|
Re: INET_NTOA Equivalent
by jaco (Pilgrim) on Apr 15, 2004 at 00:15 UTC | |
|
Re: INET_NTOA Equivalent
by iburrell (Chaplain) on Apr 15, 2004 at 20:23 UTC | |
|
Re: INET_NTOA Equivalent
by Anonymous Monk on Sep 01, 2018 at 13:24 UTC |