in reply to zlib compression of numeric values

Null is
my $justanull = "\x00";
a little endian 4 byte integer is
$not_ascii = pack('V', 1); #or $not_ascii = pack('V', "1"); #$not_ascii should not be printed to console, it looks gibberish as as +cii
Perl has absolutely no problems in dealing with binary data aslong as you dont turn on utf8 mode for that scalar. & ^ and | work with "ascii" printable scalar integers, not on bytes or bits. After using &/^/|, you need to use pack to get it into binary. Perl historically is excellent in dealing with binary.

If you really want, you can even write machine code/shellcode in Perl, and run it also from Perl. This guy did it, Pure Perl module(246 lines, Linux/Win32) that calls external libraries - no XS file..