If you're getting bitten by endianness issues (perl will spit out the bytes in your desired order, but your hex editor might be trying to be too clever for its own good) then you may find my module
Data::Hexdumper useful, which lets you specify endianness and word size your self.