```{index} single: cowrefcnt (B::COW) ``` ```{index} single: B::COW::cowrefcnt ``` # cowrefcnt How many scalars share a copy-on-write buffer, as perl counts. ## Synopsis ```perl use B::COW qw(cowrefcnt); my $n = cowrefcnt($string); ``` ## What you get back The share count perl keeps in the last byte of the buffer, 0 for a string that shares a hash key's buffer (those have no count), or `undef` when the value is not copy-on-write.