in reply to Re^5: CRC of a string
in thread CRC of a string

/(.{1,4})/
should be
/(.{1,4})/s

grep $_, split /(.{1,4})/s, $buffer
is buggy. Fix:
$buffer =~ /(.{1,4})/sg
So much simpler too!

hex sprintf "%02X"x4, map { ord } split //, $_
can be simplified to
unpack 'N', "$_\0\0\0"
The latter should be much faster too.