Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

M-M confused by Object::Pad's class syntax #33

Open
leonerd opened this issue Mar 27, 2020 · 3 comments
Open

M-M confused by Object::Pad's class syntax #33

leonerd opened this issue Mar 27, 2020 · 3 comments

Comments

@leonerd
Copy link

leonerd commented Mar 27, 2020

Object::Pad provides a new syntax for declaring packages that provide an object class, using the class keyword. This can also set the $VERSION of the package.

class Module::Name 1.23 {
   ...
}

class Another::Module 4.56;
...

Currently Module::Metadata does not understand this syntax and fails to extract versions.

A workaround is to provide both a package and a class declaration, because doing so will not confuse Object::Pad but does mean the version is correctly extracted. E.g. see https://metacpan.org/source/PEVANS/Device-Chip-CC1101-0.03/lib/Device/Chip/CC1101.pm#L9-12:

package Device::Chip::CC1101 0.03 { } 
 
class Device::Chip::CC1101
   extends Device::Chip;
@leonerd
Copy link
Author

leonerd commented Mar 27, 2020

PR #34 attempts to implement this

@leonerd
Copy link
Author

leonerd commented Jun 13, 2020

While this is still outstanding I have documented suggestions to module authors at

https://metacpan.org/pod/Object::Pad#$VERSION-declaration

@jonassmedegaard
Copy link

Should that pod note perhaps be changed, now that the syntax is supported in Module-Metadata? Or is it still recommended to declare both package and class for backwards compatibility?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants