Read Appendix A of Effective Perl Programming. (Or say "man 3 printf" in a Linux/Unix shell ... might also help.)
Update: If you need to get the output into a text format (e.g., for redirecting into a file), do this (thanks to jmcnamara for the tip):
man 3 printf | col -b > printf.txt
The "col()" command will filter out all the terminal escapes for you.
Update: Why "man 3 printf"? Because there is a printf command, too, and you will get its man page when you just say "man printf". But you want the manpage on the printf C library call, so you have to use "man 3 printf" to indicate you want the printf entry from section 3 of the manpages, which describes (surprise) library calls. See "man man" for more details on the surprisingly useful man command.
Christian Lemburg
Brainbench MVP for Perl
http://www.brainbench.com
In reply to Re: Using printf
by clemburg
in thread Using printf
by nysus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |