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: 128531 times

Microsoft Word 2000 format (.doc):
Download link: perl's pack/unpack and printf cheat sheet (.doc)
Downloaded: 3592 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!

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 .

December 03, 2014, 09:13

Hello Nice Post great too see buddy thanks For sharing

Leave a new comment

(why do I need your e-mail?)

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

Type the word "cdrom_20": (just to make sure you're a human)

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

Advertisements