any::feature

hanekomu on 2009-02-18T13:05:25

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!

draegtun on 2009-02-18T14:43:58

And....

use any::feature 'say';

looks a bit nicer than something like....

from __future__ import with_statement

IMHO of course ;-)

/I3az/

Why the seprate namespace?

bart on 2009-02-19T17:27:30

If you want to use this both on perl 5.8.x and on perl 5.10, then you have to install any::feature on 5.10.

Wouldn't it be nicer to backport feature to 5.8, thus: rename any::feature to feature, 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:Why the seprate namespace?

hanekomu on 2009-02-19T17:49:18

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:Why the seprate namespace?

educated_foo on 2009-02-20T18:19:36

Can't you deal with this by looking at $] in your Makefile.PL?