Get a version from `(class|role) NAME VERSION` line
Since Perl 5.37.9, class NAME VERSION is a valid native class declaration. So it would be nice for PAUSE to get a version from the line. Also, role NAME VERSION would be available eventually (considering Object::Pad has that).
The change should be the following but we need to discuss what should be supported first, as it may be too early because other tools like ExtUtils::MakeMaker don't get a version from the line.
diff --git a/lib/PAUSE/pmfile.pm b/lib/PAUSE/pmfile.pm
index a637e04..374778e 100644
--- a/lib/PAUSE/pmfile.pm
+++ b/lib/PAUSE/pmfile.pm
@@ -227,7 +227,7 @@ sub packages_per_pmfile {
$pline =~ m{
(.*)
(?<![*\$\\@%&]) # no sigils
- \bpackage\s+
+ \b(?:package|class|role)\s+
([\w\:\']+)
\s*
(?: $ | [\}\;] | \{ | \s+($version::STRICT) )
The change should be the following but we need to discuss what should be supported first, as it may be too early because other tools like ExtUtils::MakeMaker don't get a version from the line.
I will look at supporting class in EUMM, Parse::PMFile and Module::Metadata at PTS 2023.
@karenetheridge FYI, I've already shipped Parse::PMFile 0.44 with class support :)
You are too fast! :)
Support for testing this improved by https://github.com/rjbs/Module-Faker/commit/f24b38f4ebc9b4d9cf51504c3032dd40c3eb43c5
cf. https://github.com/andk/pause/issues/436
cf. https://github.com/charsbar/Parse-PMFile/pull/15/files
We believe this is superceded by #447 and DONE