Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • MD5 checks are going to be identical iff the two inputs are identical (for all practical purposes).

    If you don't want to put the MD5 of the canonical version in the test case, why not put the stringified Data::Dumper value in the test? No CPAN dependency that way. :-)

    • Well, you'd have to either eval it back in and do some deep comparison, or use the 5.8ism of Data::Dumper::Sortkeys.

      I'd say use the MD5. If they don't previously have it, it will at least mean their CPAN.pm will start using it.
      --
        ---ict / Spoon
  • is a core module in 5.8.0 just in case you hadn't noticed that.

    • Just for the sake of pedantry ;) and in case someone doesn't know better, the MD5 module is deprecated, and Digest::MD5 is in 5.8.0.
  • He suggested MD5 for the checksum algorithm; but I'm hesitant about using it, since that would mean making HTML-Tree have a dependency on the MD5 module.

    Why not use the unpack() checksum: $sum = unpack "%32C*", $string;


    • Because it doesn't catch transposition:

      DB<1> sub csum { unpack "%32C*", $_[0] }

      DB<2> x csum "+abc-"
      0 382
      DB<3> x csum "-abc+"
      0 382
      DB<4>