Are you always calling create_checksum() from an instance? If you are just calling this after exporting or calling it with My::Module::create_checksum("value") then it will return the checksum of undef (which happens to be d41d8cd98f00b204e9800998ecf8427e). Two ways to fix it are to create an instance and call it from that instance, call it as My::Module->create_checksum("value"), you can call it as create_checksum(undef,"value"), or you can remove the $self = shift; line.
Of course, you should also use warnings; to alert you when you get undef values.
UPDATE: Late night and I put strict for detecting undef values rather than warnings. DOH!
antirice
The first rule of Perl club is - use Perl
The ith rule of Perl club is - follow rule i - 1 for i > 1
In reply to Re: MD5 Peculiarities
by antirice
in thread MD5 Peculiarities
by skazat
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |