in reply to Trying to make perl suck less again
But to enable it in every module that uses Moose is easy: just add feature->import(":5.10") if $] >= 5.010; in Moose::import, the same as is done for the strict and warnings pragmas (sans conditional). And a use if $] >= 5.010, "feature", ":5.10"; at the top of Moose.pm.
But this seems like a silly thing to do; I presume the real Moose distribution won't integrate a change like that, for the same reason that features aren't automatic in the first place: backwards compatibility.
It would make more sense to have a module of your own used by everything you write that loads both Moose and 5.10 features (untested):
package EvanPerl; use strict; use warnings; use Moose; use if $] >= 5.010, "feature", ":5.10"; sub import { feature->import(":5.10") if $] >= 5.010; goto &Moose::import; # can't just call Moose->import since it need +s to know the "correct" caller. } 1;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Trying to make perl suck less again
by EvanCarroll (Chaplain) on Dec 23, 2007 at 07:29 UTC | |
by ysth (Canon) on Dec 23, 2007 at 07:36 UTC | |
by Porculus (Hermit) on Dec 23, 2007 at 12:22 UTC | |
by stvn (Monsignor) on Dec 23, 2007 at 21:29 UTC | |
| |
|