in reply to Using pack/unpack on a PNG file

unpack takes a string as it's second parameter not a file handle. See the basic debugging checklist for lots of helpful advice on tracking down problems.