Front page | perl.perl5.porters |
Postings from October 2008
Re: PL_ors_sv in Devel::PPPort?
Thread Previous
From:
H.Merijn Brand
Date:
October 22, 2008 23:44
Subject:
Re: PL_ors_sv in Devel::PPPort?
Message ID:
20081023084432.12022c0e@pc09.procura.nl
On Wed, 22 Oct 2008 22:50:48 +0200, Marcus Holland-Moritz
<mhx-perl@gmx.net> wrote:
> On 2008-10-22, at 08:13:44 +0200, H.Merijn Brand wrote:
>
> > The perl internal SV for $\ is PL_ors_sv, but only for 5.8.x onwards. In
> > 5.6.x and below, it is a combination of PL_ors (a string) and PL_orslen
> > (its length). Is it possible to make "PL_ors_sv" backportable using this
> > wonderful Devel::PPPort?
>
> I don't think this is possible. On a C level, you're supposed to do
> stuff like this:
Fine, that means that I was not being stupid in giving up :)
> SvREFCNT_dec(PL_ors_sv);
> PL_ors_sv = newSVpvs("foo");
>
> There's no way to fake the left hand side of the expression to use
> PL_ors and PL_orslen instead of PL_ors_sv. Nor would it be possible
> to introduce a fake PL_ors_sv and convince older perls to use it.
>
> I think it would be possible to make PL_ors and PL_orslen work with
> newer perls, i.e. something more or less equivalent to:
>
> #define PL_ors SvPVX(PL_ors_sv)
> #define PL_orslen SvCUR(PL_ors_sv)
>
> Actually, PL_ors_sv may be NULL, so something similar to the PL_parser
> handling would need to be implemented.
This is exactly what I have to fake. I have to do a local undef $\ from
XS, which is fine in 5.8.x and up, but nearly impossible with 5.6.x and
older. I've now marked the bugfix in my module as "only works on 5.8.x
and up"
> However, I'm not sure whether that's the desired interface.
--
H.Merijn Brand Amsterdam Perl Mongers http://amsterdam.pm.org/
using & porting perl 5.6.2, 5.8.x, 5.10.x, 5.11.x on HP-UX 10.20, 11.00,
11.11, 11.23, and 11.31, SuSE 10.1, 10.2, and 10.3, AIX 5.2, and Cygwin.
http://mirrors.develooper.com/hpux/ http://www.test-smoke.org/
http://qa.perl.org http://www.goldmark.org/jeff/stupid-disclaimers/
Thread Previous