Welcome to the Monastery | |
PerlMonks |
Re: Bit-vector compressionby jwkrahn (Abbot) |
on Mar 01, 2022 at 23:32 UTC ( [id://11141741]=note: print w/replies, xml ) | Need Help?? |
You have an off-by-one problem there. Say that $str has a length of 8 and so has characters at positions 0 through 7. length($str)-1 will produce random numbers in the range 0 through 6, one less than the length of the string. Update: This produces the same result as your pack_str subroutine:
In Section
Seekers of Perl Wisdom
|
|