Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

1. Perl Pocket Reference > Structure Conversion

Structure Conversion

pack template, list

Packs the values in list into a sequence of bytes, using the specified template. Returns this sequence as a string.

unpack template, expr

Unpacks the sequence of bytes in expr into a list, using template.

template is a sequence of characters as follows:

a / A

Byte string, null-/space-padded

b / B

Bit string in ascending/descending order

c / C

Signed/unsigned byte value

d / D

Native double/long double

f / F

Native float/Perl internal float

h / H

Hex string, low/high nybble first

i / I

Signed/unsigned integer value

j / J

Perl internal integer/unsigned

l / L

Signed/unsigned long value

n / N

Short/long in network (big endian) byte order

p / P

Pointer to a null-terminated/fixed-length string

q / Q

Signed/unsigned quad value

s / S

Signed/unsigned short value


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint