perl pack unpack printf sprintf cheat sheet

I decided one day that I want to master Perl's pack() and unpack() functions to be able to manipulate data in Perl efficiently.

Perl's pack and unpack are two functions for transforming data according to a user-defined template, between the guarded way Perl stores values and some well-defined representation as might be required in the environment of a Perl program. Unfortunately, they're also two of the most misunderstood and most often overlooked functions that Perl provides.

As I wrote before, my way of learning these complex functions were to make a cheat sheet first with all the template parameters and then just spend a day reading more about them and experimenting.

As I usually print cheat sheets two pages per side and the pack/unpack cheat sheet consumed just one page, I added Perl's printf/sprintf format and attribute summary.

Here is how I printed this cheat sheet:

perl pack unpack printf sprintf cheat sheet thumbnail
(Sorry for the bad quality, I shot it with my camera phone)

Download Perl's pack/unpack and printf Cheat Sheet

PDF:
Download link: perl's pack/unpack and printf cheat sheet (.pdf)
Downloaded: 123434 times

Microsoft Word 2000 format (.doc):
Download link: perl's pack/unpack and printf cheat sheet (.doc)
Downloaded: 3325 times

Comments

October 02, 2007, 15:55

Thanks!

February 07, 2008, 00:18

My perl cheat sheet compilation has been updated with this one per your request :)
http://www.scottklarr.com/topic/106/perl-cheat-sheets/

August 19, 2009, 08:49

Handy cheat sheet, ta! Could benefit from a few examples at the end, but dead useful information nonetheless. Smart!

November 23, 2013, 06:27

nice and good printf Cheat Sheet.

Will hamlin Permalink
December 10, 2013, 03:43

Perl is on toff the most advance programming language we have.
Cheap refrigerator in french door style .

March 20, 2014, 02:00

Fantastic web site. Plenty of helpful info here. I am sending it to a few buddies ans additionally sharing in delicious. online trading And certainly, thanks on your sweat

Leave a new comment

(why do I need your e-mail?)

(Your twitter name, if you have one. (I'm @pkrumins, btw.))

Type the first letter of your name: (just to make sure you're a human)

Please preview the comment before submitting to make sure it's OK.

Advertisements