If you need that binary sequence stored in a string value, you could use sprintflike so:
my $int = 123; my $bin = sprintf "%b", $int; my $fix = sprintf "%08b", $int; print "Integer $int is binary $bin (eight-digit binary: $fix)\n";
In reply to Re^2: convert to binary number
by dbander
in thread convert to binary number
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |