in reply to Problems with 'our' definition with perl 5.00503
and then use strictitude rather than strict.package strictitude; require strict; *unimport = \&strict::unimport; sub import { if ($^V and $^V lt v5.6.0) { my $pkg = caller; *{"$pkg\::our"} = sub {@_[0..$#_]}; } else { goto &strict::import; } } 1;
The idea is simple, if the Perl version is too low, export a useless our function to prevent errors and turn off strict checks. For recent Perls do what strict does so you can catch undeclared variables.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Problems with 'our' definition with perl 5.00503
by etcshadow (Priest) on Jun 30, 2005 at 05:23 UTC | |
by tilly (Archbishop) on Jun 30, 2005 at 17:02 UTC | |
by etcshadow (Priest) on Jun 30, 2005 at 18:50 UTC | |
by Tanalis (Curate) on Jun 30, 2005 at 15:14 UTC | |
by ambrus (Abbot) on Jun 30, 2005 at 16:19 UTC | |
by cosmicperl (Chaplain) on Jun 30, 2005 at 14:37 UTC | |
by tilly (Archbishop) on Jun 30, 2005 at 17:06 UTC | |
by cosmicperl (Chaplain) on Jun 30, 2005 at 16:25 UTC |