The states were serialized into a binary form, so they can be stored and compared. They were de-serialized into a nested Perl data structure so I could manipulate the cards on the board.