Update of /cvsroot/module-build/Module-Build/lib/Module/Build
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5198/lib/Module/Build
Modified Files:
ModuleInfo.pm
Log Message:
Obscurify a VERSION-related line to hide it from VERSION-finding regexes
Index: ModuleInfo.pm
===================================================================
RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/ModuleInfo.pm,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- ModuleInfo.pm 22 Aug 2005 12:24:36 -0000 1.6
+++ ModuleInfo.pm 29 Aug 2005 11:38:16 -0000 1.7
@@ -209,12 +209,15 @@
# version.pm will change the ->VERSION method, so we mitigate the
# potential effects here. Unfortunately local(*UNIVERSAL::VERSION)
- # will crash perl < 5.8.1.
+ # will crash perl < 5.8.1. We also use *{Foo::VERSION} instead of
+ # *Foo::VERSION so that old versions of CPAN.pm, etc. with a
+ # too-permissive regex don't think we're actually declaring a
+ # version.
my $old_version = \&UNIVERSAL::VERSION;
eval {require version};
my $result = eval $eval;
- *UNIVERSAL::VERSION = $old_version;
+ *{UNIVERSAL::VERSION} = $old_version;
warn "Error evaling version line '$eval' in $self->{filename}: $@\n" if $@;
# Unbless it if it's a version.pm object
|