FreeBSD.software
Home/devel/p5-Data-Cmp

p5-Data-Cmp

0.010devel

Compare two data structures, return -1/0/1 like cmp

This relatively lightweight (no non-core dependencies, under 100 lines of code) module offers the cmp_data function that, like Perl's cmp, returns -1/0/1 value. cmp_data differs from cmp in that it can compare two data of different types and compare data items recursively, with pretty sensible semantics. In addition to returning -1/0/1, cmp_data can also return 2 if two data differ but not comparable: there is no sensible notion of which one is "greater than" the other. An example is empty hash {} vs empty array []). This module can handle circular structure.

$pkg install p5-Data-Cmp
metacpan.org/dist/Data-Cmp
Origin
devel/p5-Data-Cmp
Size
61.1KiB
License
ART10, GPLv1+
Maintainer
sunpoet@FreeBSD.org
Dependencies
1 packages
Required by
1 packages

Dependencies (1)

Required By (1)