\s* # optional whitespace
($V_NUM_REGEXP)? # optional version number
\s* # optional whitesapce
- ; # semicolon line terminator
+ [;\{] # semicolon line terminator or block start (since 5.16)
}x;
my $VARNAME_REGEXP = qr{ # match fully-qualified VERSION name
our $VERSION;
$VERSION = 'onetwothree';
---
+ $undef => <<'---', # package NAME BLOCK, undef $VERSION
+package Simple {
+ our $VERSION;
+}
+---
+ '1.23' => <<'---', # package NAME BLOCK, with $VERSION
+package Simple {
+ our $VERSION = '1.23';
+}
+---
+ '1.23' => <<'---', # package NAME VERSION BLOCK
+package Simple 1.23 {
+ 1;
+}
+---
+ 'v1.2.3_4' => <<'---', # package NAME VERSION BLOCK
+package Simple v1.2.3_4 {
+ 1;
+}
+---
);
my %modules = reverse @modules;