in reply to decimal to binary

Do something like:
print unpack('b32',pack('L',$num));
See pack/unpack for more details. You need other types for floats ('b128','d') or other integer types.

Hope this helps,

Jeroen
"We are not alone"(FZ)

Update: Noticed the posts of tadman and stefan_k. From stefan_k's link I understand that binary sprintf is only available in perl 5.6 or higher.