#!/usr/bin/perl
our
$VERSION
=
'0.999_001'
;
my
$last_version
=
undef
;
find({
wanted
=> \
&check_version
,
no_chdir
=> 1 },
'lib'
);
if
(!
defined
$last_version
) {
fail(
'Failed to find any files with $VERSION'
);
}
sub
check_version {
return
if
!m{blib/script/}xms && !m{ [.] pm \z}xms;
my
$content
= read_file(
$_
);
return
if
m{blib/script/}xms &&
$content
!~ m/\A \
my
@version_lines
=
$content
=~ m/ \s* ( [^\n]* \
$VERSION
\s* = \s* (?:
eval
\s* )? [
'"]? \d+ [^\n]* ) /gxms; # '
if
(
@version_lines
== 0) {
fail(
$_
);
}
foreach
my
$line
(
@version_lines
) {
if
(!
defined
$last_version
) {
$last_version
=
shift
@version_lines
;
pass(
$_
);
}
else
{
is(
$line
,
$last_version
,
$_
);
}
}
return
;
}