use Math::BigInt; sub bin2dec { my ($bin) = @_; return Math::BigInt->new("0b$bin"); }