http://qs1969.pair.com?node_id=11154963


in reply to Perl 5.36 warns for magic comparison

Using

#!/usr/bin/perl use strict; use warnings; use v5.36; say 'Hello, world!';

In 5.38, we see:

DB<1> use Devel::Peek; DB<2> Dump( ${"_<a.pl"}[8] ); SV = PVMG(0x55d8627958e0) at 0x55d86251ff80 REFCNT = 1 FLAGS = (IOK,POK,IsCOW,pIOK,pPOK) IV = 94387850872920 NV = 0 PV = 0x55d8628074b0 "say 'Hello, world!';\n"\0 CUR = 21 LEN = 32 COW_REFCNT = 1 DB<3> Dump( ${"_<a.pl"}[6] ); SV = PVMG(0x55d862786d50) at 0x55d86251fec0 REFCNT = 1 FLAGS = (POK,pIOK,pNOK,pPOK) IV = 0 NV = 0 PV = 0x55d8627d7d50 "use v5.36;\n"\0 CUR = 11 LEN = 16

See how "line 8" has IOK and POK, but "line 6" only has POK? That means that line 8 contains an integer in addition to the string, while line 6 contains only the string. This doesn't match the documentation.

(As a side note, why 94387850872920? In hex, it's 55D862528858, which in the same range as the addresses being dumped. So it looks like it's not just a flag, but a pointer to something.)

Note that the problem is limited to lines containing pragmas. The non-pragma unbreakable lines have IOK and a value of zero.

DB<4> use Devel::Peek;Dump( ${"_<a.pl"}[5] ); SV = PVMG(0x55856a4198d0) at 0x55856a4e9630 REFCNT = 1 FLAGS = (IOK,POK,pIOK,pPOK) IV = 0 NV = 0 PV = 0x55856a486840 "\n"\0 CUR = 1 LEN = 16

So only the lines with pragmas are broken. But this wasn't always the case. They used to be broken in a different way. Here with 5.34, we see that pragmas were once breakable.

DB<2> Dump( ${"_<a.pl"}[6] ); SV = PVMG(0x55874ddaf680) at 0x55874db508a8 REFCNT = 1 FLAGS = (IOK,POK,pIOK,pPOK) IV = 94039612799016 NV = 0 PV = 0x55874db739a0 "use v5.10;\n"\0 CUR = 11 LEN = 16

I'm guessing that when they fixed the bug marking pragmas as breakable, they forgot to set the IOK flag.

Bug report