in reply to Re^4: Why is Dumper returning "!!1" for true file test?
in thread Why is Dumper returning "!!1" for true file test?

Prior to perl 5.36 it was not possible to identify a boolean true value after it had been copied

This was done by ensuring that the string buffer (PV) of &PL_sv_yes and &PL_sv_no is shared on assignment.

$ 5.34t/bin/perl -MDevel::Peek -e'Dump(!!1); my $x = !!1; Dump($x);' SV = PVNV(0x55852a177160) at 0x55852a1753c8 REFCNT = 2147483644 FLAGS = (IOK,NOK,POK,READONLY,PROTECT,pIOK,pNOK,pPOK) IV = 1 NV = 1 PV = 0x558529a84f64 "1" CUR = 1 LEN = 0 SV = PVNV(0x55852a177220) at 0x55852a178770 REFCNT = 1 FLAGS = (IOK,NOK,POK,pIOK,pNOK,pPOK) IV = 1 NV = 1 PV = 0x55852a1b6010 "1"\0 CUR = 1 LEN = 10 $ 5.36t/bin/perl -MDevel::Peek -e'Dump(!!1); my $x = !!1; Dump($x);' SV = PVNV(0x55d55f1be160) at 0x55d55f1bc3c8 REFCNT = 2147483644 FLAGS = (IOK,NOK,POK,IsCOW,READONLY,PROTECT,pIOK,pNOK,pPOK) IV = 1 NV = 1 PV = 0x55d55e89b984 "1" [BOOL PL_Yes] CUR = 1 LEN = 0 SV = PVNV(0x55d55f1be220) at 0x55d55f1bf770 REFCNT = 1 FLAGS = (IOK,NOK,POK,IsCOW,pIOK,pNOK,pPOK) IV = 1 NV = 1 PV = 0x55d55e89b984 "1" [BOOL PL_Yes] CUR = 1 LEN = 0

is_bool checks if the provided scalar shares a string buffer (PV) with &PL_sv_yes or &PL_sv_no.

Before you had two "levels" of true:

After, three: