Skip to content

Commit ef41af2

Browse files
hakonhaglandLeont
authored andcommitted
Fix typo in pod example for comparing versions.
The example in version.pod for comparing versions line #227 says "FALSE" but it should be "TRUE" since v.95.0 < v.960.0. But if we fix it to "TRUE", it does not illustrate the trap very well, so I changed the wording a little bit.
1 parent fe76e18 commit ef41af2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/version.pod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,11 +224,11 @@ term will be converted to a version object using C<parse()>. This may give
224224
surprising results:
225225

226226
$v1 = version->parse("v0.95.0");
227-
$bool = $v1 < 0.96; # FALSE since 0.96 is v0.960.0
227+
$bool = $v1 < 0.94; # TRUE since 0.94 is v0.940.0
228228

229229
Always comparing to a version object will help avoid surprises:
230230

231-
$bool = $v1 < version->parse("v0.96.0"); # TRUE
231+
$bool = $v1 < version->parse("v0.94.0"); # FALSE
232232

233233
Note that "alpha" version objects (where the version string contains
234234
a trailing underscore segment) compare as less than the equivalent

0 commit comments

Comments
 (0)