On Wed, Sep 25, 2013 at 11:50 AM, Torsten Schoenfeld <
kaffe...@gmx.de> wrote:
>
> newSVpv (string, PL_na) // do not do this
Is this recomended anywhere? PL_na is a legacy variable that used to
be used for
str = SvPV(sv, PL_na);
in case you don't care about the length of the string. Since this will
always write the length of the string to PL_na, I can't think of any
reason why you would assume that PL_na would always be zero.
A more efficient way is to use
str = SvPV_nolen(sv);
As more and more code gets rid of using PL_na, it becomes more and
more likely that PL_na will indeed be 0 (because it has never been
used before), but as you point out, that is a dangerous assumption.
Cheers,
-Jan