in reply to Re^2: Does the experimental builtin::stringify() do anything that scalar() doesn't ?
in thread Does the experimental builtin::stringify() do anything that scalar() doesn't ?

> Why is that useful ?

Some people probably find "" . $value too obscure to understand. stringify($value) fixes the problem.

> Is there any reason (apart from oversight) for that ? Does it matter ?

Interesting. I have no idea.

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Replies are listed 'Best First'.
Re^4: Does the experimental builtin::stringify() do anything that scalar() doesn't ?
by syphilis (Archbishop) on Apr 06, 2024 at 01:48 UTC
    >> Is there any reason (apart from oversight) for that ? Does it matter ?
    > Interesting. I have no idea.


    I doubt that it matters. In this instance bultin::stringify is doing the same thing to its argument as interpolation does:
    D:\>perl -MDevel::Peek -le "$x = 100; $y = \"$x\"; Dump $x;" SV = PVIV(0x1d14cb52750) at 0x1d14cb54110 REFCNT = 1 FLAGS = (IOK,pIOK,pPOK) IV = 100 PV = 0x1d14cb85630 "100"\0 CUR = 3 LEN = 16 D:\>perl -MDevel::Peek -le "$x = 100.5; $y = \"$x\"; Dump $x;" SV = PVNV(0x1ba09babdd8) at 0x1ba09be1070 REFCNT = 1 FLAGS = (NOK,pNOK) IV = 0 NV = 100.5 PV = 0x1ba09c47d00 "100.5"\0 CUR = 5 LEN = 48
    If there was a problem with that, then it would likely have already been encountered.
    (I actually have a vague and hazy recollection that this difference wrt the pPOK flag serves a purpose.)

    Thanks also to jdporter and davido for their helpful inputs.

    Cheers,
    Rob