From: Leon Timmermans Date: Fri, 30 Aug 2013 17:36:04 +0000 (+0200) Subject: Use warnings and other 5.6isms X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6ae077f7f974541bd2c60fc3ac5d8bdd241b343c;p=p5sagit%2FModule-Metadata.git Use warnings and other 5.6isms --- diff --git a/Makefile.PL b/Makefile.PL index 9b7e4ad..50c0fab 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -1,3 +1,4 @@ +use 5.006; use strict; use warnings FATAL => 'all'; use ExtUtils::MakeMaker; diff --git a/lib/Module/Metadata.pm b/lib/Module/Metadata.pm index 0a15924..9e32dec 100644 --- a/lib/Module/Metadata.pm +++ b/lib/Module/Metadata.pm @@ -9,9 +9,10 @@ package Module::Metadata; # perl modules (assuming this may be expanded in the distant # parrot future to look at other types of modules). +use 5.006; use strict; -use vars qw($VERSION); -$VERSION = '1.000014'; +use warnings; +our $VERSION = '1.000014'; $VERSION = eval $VERSION; use Carp qw/croak/; @@ -661,15 +662,16 @@ sub _evaluate_version_line { \$$var }; }}; - - local $^W; - # Try to get the $VERSION - eval $eval; - # some modules say $VERSION = $Foo::Bar::VERSION, but Foo::Bar isn't - # installed, so we need to hunt in ./lib for it - if ( $@ =~ /Can't locate/ && -d 'lib' ) { - local @INC = ('lib',@INC); + { + no warnings; + # Try to get the $VERSION eval $eval; + # some modules say $VERSION = $Foo::Bar::VERSION, but Foo::Bar isn't + # installed, so we need to hunt in ./lib for it + if ( $@ =~ /Can't locate/ && -d 'lib' ) { + local @INC = ('lib',@INC); + eval $eval; + } } warn "Error evaling version line '$eval' in $self->{filename}: $@\n" if $@;