my $hex = sprintf "%x", oct("0b$bin");