Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: v notation and IP addresses

by jettero (Monsignor)
on Jul 11, 2009 at 22:15 UTC ( [id://779264]=note: print w/replies, xml ) Need Help??


in reply to Re: v notation and IP addresses
in thread v notation and IP addresses

Version strings are not meant to be used for IP addresses.

In fact, I think they were... Not that you should ever actually use them.

use strict; use warnings; use Socket; my $perlmonks1 = inet_aton("66.39.54.27"); my $perlmonks2 = v66.39.54.27; print "Holy crap, this really works?\n" if $perlmonks1 eq $perlmonks2;

And atually, yes, it does work for values higher than 127...

for my $IP (qw(66.39.54.27 209.197.123.153 208.159.114.4)) { my $perlmonks1 = inet_aton($IP); my $perlmonks2 = eval qq{ v$IP } or die $@; print "Holy crap, this really works ($IP)?\n" if $perlmonks1 eq $p +erlmonks2; }

-Paul

Replies are listed 'Best First'.
Re^3: v notation and IP addresses
by jwkrahn (Abbot) on Jul 11, 2009 at 22:19 UTC

    How do you morph "Version Strings" into "meant to be used for IP addresses"?

      I don't. As far as I know, historically speaking, they were just called version strings. They were always intended for encoding octets usefully. I'm not saying it was a good idea, I'm just saying they intended it.

      -Paul

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://779264]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2024-04-16 03:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found