Um, whoa :) but it also says This can be useful for displaying ordinal values of characters in arbitrary strings , so to review all it says:
* interpret the supplied string (argument is string)
* as a vector of integers (list of integers),
* one for each character in the string (character by character, integer by integer).
* ordinal values of characters in arbitrary strings (ordinal means numeric, means ordinal values of chracters )
* printf "%vd", "AB\x{100}"; # prints "65.66.256" (A is 65, B is 66, \x{100} is 256 )
I suppose its better say/link
ordinal (ord) values of characters (chr)
and give explicit chr/ord example
Or say ...interpret supplied string as list of integers seperated by a dot. Each character is a positive integer, the ordinal(ord) value of the character (chr).
$ perl -le " printf qq{v%vd\n}, join q//, map {chr $_} 1000, 44000, 99
+000 , 12 "
v1000.44000.99000.12
$ perl -le " printf qq{v%vd\n}, v3.14.16.5 "
v3.14.16.5
$ perl -le " printf qq{v%vd\n}, v1.2.3 "
v1.2.3
$ perl -le " printf qq{v%vd\n}, chr(1).chr(2).chr(3) "
v1.2.3
$ perl -le " print q{v}, join q{.}, ord(chr 1), ord(chr 2), ord(chr 3)
+ "
v1.2.3
$ perl -MData::Dump -e " dd(join q//, chr 1, chr 2, chr 3 ) "
"\1\2\3"
$ perl -le " printf qq{v%vd\n}, qq{\1\2\3} "
v1.2.3
$ perl -le " printf qq{bits are %0*v8b\n}, q{ }, q{123}; "
bits are 00110001 00110010 00110011
$ perl -le " printf qq{bits are %0*v8b\n}, q{-}, q{123}; "
bits are 00110001-00110010-00110011
$ perl -le " print q{bits are }, join q{-}, unpack q{(B8)*}, q{123} "
bits are 00110001-00110010-00110011
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.