Created
March 16, 2023 03:51
-
-
Save gugod/494a91342bb880a62439960cc476536b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Original version: https://github.com/gugod/App-perlbrew/blob/915e60b80d669c46aa77b78ccf01c3d37a3ec41d/lib/App/perlbrew.pm#L604 | |
sub comparable_perl_version { | |
my ($self, $pv) = @_; | |
my ($mc, $mi, $mp) = $pv =~ /^(?:(c?perl)-?)?(\d)\.(\d+).(\d+)|^(?:(c?perl)-?)?-?blead$/ | |
? ($1 && $1 eq 'cperl' ? -1 : 1) * sprintf('%02d%02d%02d%s', $2 + ($1 && $1 eq 'cperl' ? 6 : 0), $3, $4, $5 || '') | |
: (0,0,0); | |
return $mc . $mi . $mp; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment