Anti-nuisance lawsuit warning: The purpose of these notes is to remind me, Zoegond, of stuff or to help me work stuff out. They may contain mistakes.

Quick

  • ($a, $b....) = unpack("A2A7...", $packed)
  • push( array, list )

Friday, April 25, 2014

unpack

You skip characters in the input with x, eg

unpack("A1x2A8", "1..Hartnell")

This is badly explained in the documentation, which is all written in terms of pack and so explains 'x' as meaning 'insert a null byte'.

Case is significant in pack codes, and particularly in this one: 'X' means 'back up a byte in the input'.

Followers

Blog Archive