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); #### new 0x55fd7b6db1e0 : SV = PV(0x55fd7b6dbe60) at 0x55fd7b6db1e0 REFCNT = 1 FLAGS = (POK,IsCOW,pPOK) PV = 0x55fd7b713c00 "TESTING STRING"\0 CUR = 14 LEN = 16 COW_REFCNT = 1 #### 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); #### new 0x561fa5f971e0 : SV = PV(0x561fa5f97e60) at 0x561fa5f971e0 REFCNT = 1 FLAGS = (POK,IsCOW,pPOK) PV = 0x561fa5fc6320 "TESTING STRING"\0 CUR = 14 LEN = 16 COW_REFCNT = 1 #### 1 new 000000000072a728 :