in reply to Re^2: Text::ExtractWords exhibits incomprehensible behavior?
in thread Text::ExtractWords exhibits incomprehensible behavior?

That's the SV addresses that are different. Try Devel::Peek's Dump function to see what the PV is? I suspect this is supposed to be copy-on-write (COW), but that the XS code is just overwriting the (still-shared) data area without doing the correct COW API stuff.
  • Comment on Re^3: Text::ExtractWords exhibits incomprehensible behavior?

Replies are listed 'Best First'.
Re^4: Text::ExtractWords exhibits incomprehensible behavior?
by ibm1620 (Hermit) on Jun 16, 2024 at 22:14 UTC
    That must be it.
    v5.40.0 Text: 12/21/84 Bob's 21st b'day was a wine-and-dine. Copy: 12/21/84 Bob's 21st b'day was a wine-and-dine. SV = PV(0x15780b090) at 0x1578242d0 REFCNT = 1 FLAGS = (POK,IsCOW,pPOK) PV = 0x6000019a1fe0 "12/21/84 Bob's 21st b'day was a wine-and-dine." +\0 CUR = 46 LEN = 48 COW_REFCNT = 2 SV = PV(0x15780b0b0) at 0x157824258 REFCNT = 1 FLAGS = (POK,IsCOW,pPOK) PV = 0x6000019a1fe0 "12/21/84 Bob's 21st b'day was a wine-and-dine." +\0 CUR = 46 LEN = 48 COW_REFCNT = 2 Found words: [12] [21] [84] [bob's] [21st] [b'day] [was] [a] [wine-and +-dine] Text: 122184bob's21stb'daywasawine-and-dine Copy: 122184bob's21stb'daywasawine-and-dine SV = PV(0x15780b090) at 0x1578242d0 REFCNT = 1 FLAGS = (POK,IsCOW,pPOK) PV = 0x6000019a1fe0 "12\x0021\x0084\x00bob's\x0021st\x00b'day\x00was +\x00a\x00wine-and-dine\x00"\0 CUR = 46 LEN = 48 COW_REFCNT = 2 SV = PV(0x15780b0b0) at 0x157824258 REFCNT = 1 FLAGS = (POK,IsCOW,pPOK) PV = 0x6000019a1fe0 "12\x0021\x0084\x00bob's\x0021st\x00b'day\x00was +\x00a\x00wine-and-dine\x00"\0 CUR = 46 LEN = 48 COW_REFCNT = 2
      I'd suggest filing a bug with the module with your nice short testcase, since it's clearly not supposed to do that.
        I found a README that requested bug reports be sent as emails to the author. Have done so, including a link to this thread.