[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] Simplification #2



1999-06-30-20:47:00 Vicki Brown:
> 	# Problem - pad out a string
>[ with NULL bytes, to a length that's a multiple of 4 bytes ]

I'd probably start with something like:

	$str .= "\0" x (4 - (length($str) % 4)) if length(str) % 4;

then add or subtract one until I got the desired behavior:-).

-Bennett

==== Want to unsubscribe from Fun With Perl?
==== Well, if you insist... Send mail with body "unsubscribe" to
==== fwp-request@technofile.org