If I were doing this, only the PV would be shared and I'd expect SvREADONLY to work until the scalar is destroyed.
I think Perl really needs to support this type of thing. I run into lots of cases where it would be nice to have Perl offer (efficient) read-only access to a block of memory that it didn't allocate and be smart enough to not try to free that block when the scalar is destroyed (and possibly call a hook instead). There are convoluted and inefficient ways to get Perl to kind-of do this.
- tye
In reply to Re: Reliability of SvREADONLY (PV, need)
by tye
in thread Reliability of SvREADONLY
by hardburn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |