lightoverhead has asked for the wisdom of the Perl Monks concerning the following question:
Dear Monks,
I have a question regarding the "v" flag for "printf".
printf "<%vd>","123";
I thought the result should be "<1.2.3>", but instead it was "<49.50.51>".
As it was described, "This flag tells Perl to interpret the supplied string as a vector of integers, one for each character in the string. Perl applies the format to each integer in turn, then joins the resulting strings with a separator (a dot . by default)"
I assume "123" will be divided as vector of ("1","2","3"), but it became ("49","50","51").
I am confused!
in addition if I want printf to output result of "100 200 300" of string "100200300" what should I do?
Thanks you!
Back to
Seekers of Perl Wisdom