#!/usr/bin/perl -slw use strict; use warnings; use B; use Clone::Fast; use Object::Destroyer; my $ref = {}; print B::svref_2object($ref)->REFCNT; my $copy = Clone::Fast::clone($ref); print B::svref_2object($ref)->REFCNT; my $sentry = Object::Destroyer->new(sub { undef $copy }); print B::svref_2object($ref)->REFCNT;