I have a string that is essentially binary
my $string = "000110";
I've been trying to use encode_base64 but that encodes strings, if im reading the documentation correctly.
my $j = MIME::Base64->encode_base64($string);
print "$j\n"; # should print 'A'
>> TUlNRTo6QmFzZTY000000
How can I achive this in perl? the string is expected to be ~120 binary bits in length. I'd rather not use any modules that are not installed with perl by default, the target audience for this script is not familiar with the shell.
Edit: A lot of the answers to this question have been surrounded about strings, not actual numbers, there was one solution I found, but it required Math::BaseCalc module to be installed.
Edit2: Essentially, if i have
my $binary_string = "000110";
i would like to have it encoded in base64 (as a number), so it returns
>>G # for this case (binary number 000110 to base64 number = G)