Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!
  • Perl

Idiom #114 Test deep equality

Set boolean b to true if objects x and y contain the same values, recursively comparing all referenced elements in x and y.
Tell if the code correctly handles recursive types.

use Data::Compare;
my $b = Compare($x, $y);

Old module with twenty years worth of patches, it probably works for absolutely everything by now
(def b (identical? x y))

for external entities, identical will check if references point to the same object

New implementation...
< >
programming-idioms.org