Re: Is Devel::Peek not showing everything? COW oddness and concerns about no-oping /p regex modifiers

[email protected] (Richard Leach) Thu, 12 Feb 2026 22:17:30 +0000
Newsgroups perl.perl5.porters
Message-ID <CADWSe2e5+RjqO2Nzt0+VAL1f8ORZ7hDpkmC-kgTj4SFSX1nL5w@mail.gmail.com>
On Thu, 12 Feb 2026 at 22:07, Richard Leach
<[email protected]> wrote:
>
> On Thu, 12 Feb 2026 at 11:01, demerphq <[email protected]> wrote:
> > Can anybody think of why the first example does not COW and the second does?
> >
> >  $ echo 0123456789 > n.txt
> >  $ ./perl -Ilib -MDevel::Peek -e'while (<>) { my $x = $_; my $y = $_; Dump($_);} ' n.txt
>
> It _might_ be that "0123456789" in the first example falls outside the
> current COWing heuristics.


It is that. The condition (CHECK_COW_THRESHOLD(cur,len) && cur+1 <
len) in S_SvPV_shared_hkey_or_CoWable is not met.