From: David Golden Date: Thu, 12 Nov 2009 15:46:30 +0000 (-0500) Subject: Change perl -v version format X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ded326e4b6fad7e2479796691d0c27b89d2fe080;p=p5sagit%2Fp5-mst-13.2.git Change perl -v version format New format: This is perl 5, version 11, subversion 1 (v5.11.1) ... The rationale for this change is that the Perl 5 interpreter will never increment PERL_REVISION from 5 to 6, so we want people to start focusing on the PERL_VERSION number as most significant and PERL_SUBVERSION as equivalent to a "release number". In other words, "perl 5" is a language, this is the 11th version of it, and the second release of that version (counting from zero). Among other things, this makes the output of -v and -V more consistent. The old v-string style is included for familiarity and usage in code. For builds from git, it will include the same extended format as it did before, e.g. "(v5.11.1-176-gaf24cc9*)" --- diff --git a/perl.c b/perl.c index 3ffd3fc..a9abdb4 100644 --- a/perl.c +++ b/perl.c @@ -3222,9 +3222,11 @@ Perl_moreswitches(pTHX_ const char *s) } #endif PerlIO_printf(PerlIO_stdout(), - "\nThis is perl, %"SVf - " built for " ARCHNAME, - level); + "\nThis is perl " STRINGIFY(PERL_REVISION) + ", version " STRINGIFY(PERL_VERSION) + ", subversion " STRINGIFY(PERL_SUBVERSION) + " (%"SVf") built for " ARCHNAME, level + ); SvREFCNT_dec(level); } #else /* DGUX */ diff --git a/t/run/switches.t b/t/run/switches.t index 8e076d4..20cb772 100644 --- a/t/run/switches.t +++ b/t/run/switches.t @@ -267,8 +267,10 @@ SWTESTPM # there are definitely known build configs where this test will fail # DG/UX comes to mind. Maybe we should remove these special cases? my $v = sprintf "%vd", $^V; + my $ver = $Config{PERL_VERSION}; + my $rel = $Config{PERL_SUBVERSION}; like( runperl( switches => ['-v'] ), - qr/This is perl, v\Q$v\E(?:[-*\w]+| \([^)]+\))? built for \Q$Config{archname}\E.+Copyright.+Larry Wall.+Artistic License.+GNU General Public License/s, + qr/This is perl 5, version \Q$ver\E, subversion \Q$rel\E \(v\Q$v\E(?:[-*\w]+| \([^)]+\))?\) built for \Q$Config{archname}\E.+Copyright.+Larry Wall.+Artistic License.+GNU General Public License/s, '-v looks okay' ); }