in reply to C to Perl

This piece of code is actualy to build a packet to be sent to a server. How would I approach padding out cmd with zero's

Replies are listed 'Best First'.
Re: Re: C to Perl
by tall_man (Parson) on Apr 07, 2003 at 17:58 UTC
    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