Excellent investigation,
gmax. In fact, the problem is that md5_hex is purely a standalone function, never a method. By calling it as a method, the original poster has been calculating the MD5 checksum of the scalar representation of the object $ctx, likely something similar to Digest::MD5=SCALAR(0x804c340), which of course will be different each time.
--isotope