Perl/Tk saves your favourite tools

Main
back: Atsar replacement -1
next: Atsar replacement -3

pack converts a list into a row of bytes (string) and unpack does the reverse. These commands get a conversion string, where the elements to look for are represented by single characters.

In most cases, a character followed by a number means that many times the specific type. For instance, i3 means "3 integers". For strings this is different; A64 means "one string of 64 characters".

In the second unpack example, I had to add three alignment characters in my format. The undef in the left list works as a dummy variable: the alignment bytes are just thrown away.

 
Atsar replacement -1 Atsar replacement -3

Created by Mark Overmeer with PPresenter on 11 juli 2001.