is_cow#

Whether a string shares its buffer copy-on-write.

Synopsis#

use B::COW qw(is_cow);
my $copy = $string;
print is_cow($copy) ? "shared\n" : "own buffer\n";

What you get back#

True for a string value whose buffer is shared copy-on-write with other scalars or with a hash key, false otherwise - including for a value that is not a string.