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 )

Tuesday, February 19, 2013

Reading and writing to the same file

Firstly, don't use +> with open, as this truncates the file on opening.

Secondly, +< works, but it appends to the file. You can seek back to the start for reading, but anything you write will go on the end of the file, no matter where the last read was from.

Followers

Blog Archive