use strict; use warnings; use Devel::Leak; my $string = "TESTING STRING"; my $count = Devel::Leak::NoteSV (my $handle); print ($string =~ s/\ STRING//); undef $string; Devel::Leak::CheckSV ($handle);