Why is the version not printable?
1 answer
I found this DOC
print v9786; # prints SMILEY, "\x{263a}"
print v102.111.111; # prints "foo"
print 102.111.111; # same
Answering my question:
Although v1.02
there is v-string
, which is not internal. And when we want to print it, we have to take additional steps. For example, use the module version
as suggested above.
UPD
I found the following solution ( DOC ):
printf "%vd", $VERSION; # prints "1.2"
UPD
And this should be read:
There are two ways to enter v-strings: a bare number with two or more decimal points, or a bare number with one or more decimal points and a leading "v" character (also bare). For example:
$vs1 = 1.2.3; # encoded as \1\2\3
$vs2 = v1.2; # encoded as \1\2
+6
source to share