in reply to Re: C to Perl
in thread C to Perl

There are several ways to null-pad using pack. You could use "Z" format as I suggested above, or "x" to put in a specific number of null bytes, or "@" to null-fill to a specific position. The documentation for pack can be found using:
perldoc -f pack