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

RT #110074: 5.011 == 5.11 in 1.013 #7

Closed
briandfoy opened this issue Jan 4, 2024 · 3 comments
Closed

RT #110074: 5.011 == 5.11 in 1.013 #7

briandfoy opened this issue Jan 4, 2024 · 3 comments
Assignees
Labels
imported by rt.cpan.org issues from the old tracker Status: verified issue has been verified (is reproducible) Type: question clarify something

Comments

@briandfoy
Copy link
Owner

From Gabor in #110074 on rt.cpan.org:

Using Perl::Version 1.013 I got that this

Perl::Version->new('5.011') == Perl::Version->new('5.11')

returns true.

Is that the expected behavior?

@briandfoy briandfoy added imported by rt.cpan.org issues from the old tracker Status: needs verification issue needs to be verified Priority: low get to this whenever Status: verified issue has been verified (is reproducible) and removed Status: needs verification issue needs to be verified labels Jan 4, 2024
@briandfoy briandfoy self-assigned this Jan 4, 2024
@briandfoy
Copy link
Owner Author

briandfoy commented Jan 4, 2024

I added t/99.rt-110074.t for this, and I updated the docs.

(UPDATED) I think this is the expected behavior based on how Perl (the project) and CPAN treat semantic version numbers even if there are only two components, which is a bit weird. If this were a general version module for the entire Internet, I would say this is wrong.

briandfoy added a commit that referenced this issue Jan 4, 2024
@briandfoy briandfoy added Type: question clarify something and removed Priority: low get to this whenever labels Jan 4, 2024
@Grinnz
Copy link

Grinnz commented Jan 4, 2024

This is not how Perl and CPAN treat version numbers, and why Perl::Version has not been suitable for me to bump version numbers. See https://blogs.perl.org/users/grinnz/2018/04/a-guide-to-versions-in-perl.html - these are treated as decimal (float) versions by Perl.

@briandfoy
Copy link
Owner Author

briandfoy commented Jan 4, 2024

Yes, you are right. It pads in groups of three on the other side.

But, this is what Perl::Version does, and without a major version bump to break that behavior, this is what it's going to keep doing. I didn't write this stuff, it's a pain to deal with, and I'm not going to rewrite it. There are lots of other broken things too.

I don't use this for version bumping either. I have a different tool for that, and I don't bother trying to be slick. I just use the literal string I specify without letting something guess what incrementing some part means.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
imported by rt.cpan.org issues from the old tracker Status: verified issue has been verified (is reproducible) Type: question clarify something
Projects
None yet
Development

No branches or pull requests

2 participants