10 my $last_version = undef;
11 find({wanted => \&check_version, no_chdir => 1}, 'blib');
12 if (! defined $last_version) {
13 fail('Failed to find any files with $VERSION');
17 return if (! m{blib/script/}xms && ! m{\.pm \z}xms);
21 open $fh, '<', $_ or die $!;
26 $content =~ s/^__END__.*//xms;
28 # only look at perl scripts, not sh scripts
29 return if (m{blib/script/}xms && $content !~ m/\A \#![^\r\n]+?perl/xms);
31 my @version_lines = $content =~ m/ ( [^\n]* \$VERSION [^\n]* ) /gxms;
32 # Special cases for printing/documenting version numbers
33 @version_lines = grep {! m/(?:\\|\"|\'|C<|v)\$VERSION/xms} @version_lines;
34 @version_lines = grep {! m/^\s*\#/xms} @version_lines;
35 if (@version_lines == 0) {
38 for my $line (@version_lines) {
39 if (!defined $last_version) {
40 $last_version = shift @version_lines;
44 is($line, $last_version, $_);
51 # cperl-indent-level: 4
53 # indent-tabs-mode: nil
54 # c-indentation-style: bsd
56 # ex: set ts=8 sts=4 sw=4 tw=78 ft=perl expandtab shiftround :