|Perl Monk, Perl Meditation|
Trying to make perl suck less againby EvanCarroll (Chaplain)
|on Dec 22, 2007 at 17:06 UTC||Need Help??|
EvanCarroll has asked for the
wisdom of the Perl Monks concerning the following question:
OK, so in my quest to make Perl suck even less, I'm trying to hack in the ability to turn on v5.10 features with the usage of Moose, but only If perl is 5.10.
I'm not sure how to do this. Any ideas? The trick is you don't want Moose to be v5.10 only, but you want Moose to use feature ':5.10', if the version of the perl interpreter is v5.10+. This is tricky, because this information is known at compile-time, but I'm not sure how to do a compile time conditional that invokes the necessary 'use', to put the interpreter in 5.10 mode. When I was playing around with it a require wouldn't suffice.
The goal is simple to eliminate the need to use features ':5.10' all over the place. I realize the downside of this: upgrading interpreters has a higher probably of breaking v5.8 code (which is possible anyway).
Thanks in advance, one day Perl will suck even less.