in reply to decimal to binary

Here's a bintodec function:
sub bintodec { unpack("N", pack("B32", substr("0" x 32 . shift, -32))); }
Taken from the pack manpage.

And this seems to work for a dectobin, although there's probably a faster way w/o using join:

sub dectobin { join '', unpack "B32", pack "N", shift; }