in reply to convert decimal to binary with unpack problem

Part of your problem is that you are assuming that 00110100 is the binary equivalent of 2100 (hex 834). It is the binary equivalent of 52 (hex 34). Sounds like your calculator is broken (:

quick and dirty hack: print unpack("B*",chr(52)),$/;

fixed typo