On Mon, Nov 18, 2002 at 07:39:43PM +0000, Graham Barr wrote:
: On Mon, Nov 18, 2002 at 10:59:07AM -0800, Larry Wall wrote:
: > I'm thinking at the moment that I'd like to go back to the Ada notation
: > and use # for the radix, and rather that using dots, use colons. So
: > an IP address would actually look like
: >
: > 256#192:168:1:1
: >
: > (But only on a big-endian machine! Use v-strings instead!)
:
: Why only on big-endian ? This is a just a number. To use it
: as an IP address you would need to pack it with pack("N",256#192:168:1:1)
: which should work on any endian machine. Or am I missing something
True, it's just a number in Perl. But if you passed it to a C routine
that took a number for a network address and if that routine then
just passed the address of that number as if it were a string, it
would be wrong on little-endian machines. Not a problem in practice,
especially now that C programs are expected to use inet_ntoa() and
friends. Back in the bad old days, it was a different story...
The problem doesn't arise in the first place if you think of a network
address as a string. Pretty much everyone agrees which end of a
string comes first. :-)
Larry