Basic HTML version of Foils prepared Sept 20 97

Foil 53 pack and unpack Functions -- II

From Perl5 and Advanced Perl4 Features Computational Science for Information Age Course CPS616 -- Sept 20 97. by Geoffrey C. Fox,Nancy McCracken,Tom Scavo


The last line finds encoded hex characters %XY with X,Y in set A-F,a-f,0-9 and replaces them by the "real" character representation
  • $1 is of course matched XY pair and "C" in pack first argument tells pack to generate character
  • hex() is a Perl built in function to convert HEX strings to decimal
General syntax is pack(TEMPLATE,LIST) where TEMPLATE is a string of identifiers specifying output style of successive characters
(A is Ascii, l signed long, p pointer, f Float etc.)



© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Sun Apr 5 1998