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:07:04 +0000
Newsgroups perl.perl5.porters
Message-ID <CADWSe2e0hNgLLk1=yAF7qqNcN-pm36W40Vy+=VsaWttv8QRhZg@mail.gmail.com>
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
...
> $ ./perl -Ilib -MDevel::Peek -e'$_= "01234567889\n"; my $x = $_; my $y = $_; Dump($_); '

In the second example, "01234567889\n" is compiled into a
(POK,IsCOW,pPOK) OP_CONST ready to share.

It _might_ be that "0123456789" in the first example falls outside the
current COWing heuristics.