How can I convert the binary string $x_bin=\"0001001100101\" to its numeric value $x_num=613 in Perl?
$x_bin=\"0001001100101\"
$x_num=613
Actually you can just stick '0b' on the front and it's treated as a binary number.
perl -le 'print 0b101' 5
But this only works for a bareword.