in reply to int to ascii
You need to take a look at the ord, pack, and chr functions. (Look at the first example for 'pack').
map may also fit into your solution someplace. Hint hint. :)
You don't need to typecast it. Perl is a loosely-typed language. There is no syntax to typecast things in Perl.
my $foo = pack("cccc",65,66,67,68);
Now who says that "A" is a byte? Maybe my operating system uses Unicode and "A" is two bytes. Isn't ASCII a 7-bit encoding scheme? (A byte is eight bits, not 7.)
So why do the bytes that pack returns necessarily print out as 'ABCD' and not as gibberish?