print \1; # SCALAR(0xdf00e0) print \1; # SCALAR(0xdef540)
I don't understand what of interest that's supposed to show. The first line has a compile-time literal value 1, and a run-time operator, \. The second line has another literal and op. Whether the two literals resolve to the same SV internally is entirely down to how the compiler optimises things. As it happens perl doesn't look for common shared constants.
(Also as it happens, \1 is constant-folded at compile time, in the same way that 1+2 is.)
|Replies are listed 'Best First'.|
Re^10: Shouldn't references be readonly? (updated)
by LanX (Sage) on Aug 06, 2020 at 12:26 UTC