I've released any::feature. (It will take a while to appear on CPAN; look at the development repo on github.) It can be used like Perl 5.10's 'feature' pragma and will try to "do the right thing", regardless of whether you use Perl 5.8 or Perl 5.10.
So far it's a proof-of-concept and will only handle the 'say' feature.
Read about it in my blog.
Nice! (Score:1)
use any::feature 'say';looks a bit nicer than something like....
from __future__ import with_statementIMHO of course
Why the seprate namespace? (Score:2)
If you want to use this both on perl 5.8.x and on perl 5.10, then you have to install any::feature [cpan.org] on 5.10.
Wouldn't it be nicer to backport feature [cpan.org] to 5.8, thus: rename any::feature [cpan.org] to feature [cpan.org], and make it only installable on 5.8? (Not sure how the latter would work)
I'm not saying this is the best solution, but it's the solution I like better, among the options that I see.
Re: (Score:1)
I thought about that, but somehow it feels wrong to stomp on someone else's namespace; especially it's not clear what would happen if someone on 5.10 (or later) would use "install feature" in the CPAN shell...
Re: (Score:1)
Can't you deal with this by looking at $] in your Makefile.PL?