use Storable; sub deeply_equal { my ( $a_ref, $b_ref ) = @_; local $Storable::canonical = 1; return Storable::freeze( $a_ref ) eq Storable::freeze( $b_ref ); }