The camel book suggests that V-strings can be used to represent IPv4 addresses:
$ipaddr = 204.148.40.9; # the IPv4 address of oreilly.com
But perldata on the topic "Version Strings":
Note that using v-strings for IPv4 addresses is not portable unless you also use inet_aton () / inet_ntoa () Socket routines.
I have two questions:
1) Why is the use of v-lines not portable?2) What is the “standard” way to convert ip address from dot notation to integer? It seems that it unpack "N", <v-string>can sometimes cause problems.
unpack "N", <v-string>
"" - inet_aton, IP-, , ? , , , , IO:: Socket.
inet_aton
, , , ( C, , , Perl), pack , - , , , . , unpack "N", pack "C4", split /\./, "1.2.3.4" ( 16909060 == 0x01020304).
pack
unpack "N", pack "C4", split /\./, "1.2.3.4"
0x01020304
Source: https://habr.com/ru/post/1776493/More articles:How useful are delegates? - jqueryProblem launching a UNIX shell script from an Oracle parallel program - unixPHP GIF / PNG True Colorize Filter that preserves brightness and alpha - phpСтатус обратного вызова запроса "textStatus" - jqueryНасколько эффективна параллельная обработка и присвоение ядра MATLAB ядрам? - parallel-processingAutomated releases using Hudson + Ant + Subversion - javaSQL calculates the number of days of stay by month, by user, by location - sqlSubmitting Akka actorRef in json - jsonAny examples of custom Google API search in Android? - androidiphone - background image problem uitextview - iphoneAll Articles