How can I convert a binary number to a string character using a Perl script?
If you mean ASCII binary like this webpage, this should do the trick:
#!/usr/bin/perl $binarySample = "01010100011001010111001101110100"; # "Test" in binary $chars = length($binarySample); @packArray = pack("B$chars",$binarySample); print "@packArray\n";
exit:
Test
chr(0x41) or chr(65) converts the number 65 (41 in hex) to the letter "A" is that what you are looking for?
chr(0x41)
chr(65)
Strings can contain either binary data or text characters; nothing special is required.
Tell us more about what you are trying to do and it may shed some light on what you mean by "convert" or "binary".