This is Perl pack/unpack template parameter and printf/sprintf format specifier cheat sheet
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


This is Perl pack/unpack/printf/sprintf cheat sheet. The pack/unpack cheat
sheet is on page one, and it lists the pack/unpack template parameters and what
they do. The printf/sprintf cheat sheet is on page two, and it lists the
printf/sprintf format specifiers and format attributes.

I created this when I was mastering what could be done with pack/unpack. I
added printf/sprintf as I could never remember all the format specifiers.


This cheat sheet was created by Peteris Krumins (
His blog is at  --  good coders code, great reuse.

The cheat sheet is released under GNU Free Documentation License.

The cheat sheet was also featured in my article "Perl pack/unpack and printf
Cheat Sheet". This article can be read here:


The cheat sheet is available in .pdf and .doc (microsoft word) formats. The
latest versions can always be found at:


I'm sorry that I used microsoft word to create it, but I was not proficient in
LaTeX back then.


I hope someone finds it useful. One can also find all this information in
perldoc pages and man pages:

    $ perldoc perlpacktut
    $ perldoc -f pack
    $ perldoc -f unpack
    $ perldoc -f sprintf
    $ perldoc -f printf
    $ man 3 printf
    $ man 3 sprintf


Peteris Krumins