List Info

Thread: Dual-lifing constant.pm




Dual-lifing constant.pm
user name
2007-09-24 19:11:46
Hello,


As i said in a previous mail, Nicholas suggested to
dual-life  
constant.pm in order to provide its new features to older
Perls. So I  
spent some time on it and now it works with Perl 5.6 and
5.005. The  
current tarball is available at http://www.maddingue.net/ 
constant-1.11.tar.gz

If nobody has an objection, I'll upload it on the CPAN
tomorrow.
Attached is the corresponding patch to Maintainers.pl



-- 
Sébastien Aperghis-Tramoni

Close the world, txEn eht nepO.



  
Re: Dual-lifing constant.pm
user name
2007-09-25 02:10:19
On 9/24/07, Sébastien Aperghis-Tramoni <maddinguefree.fr> wrote:
> Hello,
>
>
> As i said in a previous mail, Nicholas suggested to
dual-life
> constant.pm in order to provide its new features to
older Perls. So I
> spent some time on it and now it works with Perl 5.6
and 5.005. The
> current tarball is available at http://www.maddingue.net/
> constant-1.11.tar.gz
>
> If nobody has an objection, I'll upload it on the CPAN
tomorrow.
> Attached is the corresponding patch to Maintainers.pl
>

Near the end of import(), there's a call to
mro::method_changed_in(),
which is only going to work 5.9.5+.  MRO::Compat would give
it to you
down to 5.6.0, but it looks like you want compat back to
5.005.  Now
that I stared at it for a minute, really that whole area is
suspect on
5.8.x and earlier perls, as it uses the readonly scalar
reference
trick, which afaik is new.  If you want a dual-lifed version
that
works on all 5.005+ Perls, you're going to need more
conditional code
to swap in the functionality of the older constant.pm's.

-- Brandon
Re: Dual-lifing constant.pm
country flaguser name
France
2007-09-25 04:18:32
Brandon Black wrote:

> Near the end of import(), there's a call to
mro::method_changed_in(),
> which is only going to work 5.9.5+.  MRO::Compat would
give it to you
> down to 5.6.0, but it looks like you want compat back
to 5.005.  Now
> that I stared at it for a minute, really that whole
area is suspect on
> 5.8.x and earlier perls, as it uses the readonly scalar
reference
> trick, which afaik is new.  If you want a dual-lifed
version that
> works on all 5.005+ Perls, you're going to need more
conditional code
> to swap in the functionality of the older
constant.pm's.

I had wondered about this myself, but then I saw in the code
that the
calls to Internals::SvREADONLY() and
mro::method_changed_in() are
protected by an if($symtab), and $symtab itself is only
affected if
$] > 5.009002

As a matter of facts, I didn't have to change anything to
make the code
work on 5.6 and only handle the z/Z thing to make it work
on 5.005
(and of course fix the tests).

-- 
Sébastien Aperghis-Tramoni

Close the world, txEn eht nepO.

Re: Dual-lifing constant.pm
user name
2007-09-25 03:37:40
On 25/09/2007, Sébastien Aperghis-Tramoni <maddinguefree.fr> wrote:
> If nobody has an objection, I'll upload it on the CPAN
tomorrow.
> Attached is the corresponding patch to Maintainers.pl

Thanks, applied.

Re: Dual-lifing constant.pm
user name
2007-09-25 12:01:39
On 9/25/07, Sébastien Aperghis-Tramoni <maddinguefree.fr> wrote:
> Brandon Black wrote:
>
> > Near the end of import(), there's a call to
mro::method_changed_in(),
> > which is only going to work 5.9.5+.  MRO::Compat
would give it to you
> > down to 5.6.0, but it looks like you want compat
back to 5.005.  Now
> > that I stared at it for a minute, really that
whole area is suspect on
> > 5.8.x and earlier perls, as it uses the readonly
scalar reference
> > trick, which afaik is new.  If you want a
dual-lifed version that
> > works on all 5.005+ Perls, you're going to need
more conditional code
> > to swap in the functionality of the older
constant.pm's.
>
> I had wondered about this myself, but then I saw in the
code that the
> calls to Internals::SvREADONLY() and
mro::method_changed_in() are
> protected by an if($symtab), and $symtab itself is only
affected if
> $] > 5.009002
>
> As a matter of facts, I didn't have to change anything
to make the code
> work on 5.6 and only handle the z/Z thing to make it
work on 5.005
> (and of course fix the tests).
>

Doh, I guess I missed that part, ignore me 

-- Brandon
[1-5]

about | contact  Other archives ( Real Estate discussion Medical topics )