ITADN
Perl/perl5/Issues

Shorten "perl --version" output

#24358OpenrubyFeedback 创建于 2026-04-11
Feature Request
R
rubyFeedbackcommented
Explanation before I file this here; but note that this is not necessarily a bug, just something that could be improved in a tiny wee bit manner. I use a ruby script to generate the current versions of all installed programs, on Linux primarily. This also includes perl. For perl I am using this: perl --version Same for ruby and python (ruby --version, and python --version). Let me first show to you guys the result of ruby and python. Ruby reports: ruby 4.0.2 (2026-03-17 revision d3da9fec82) +PRISM [x86_64-linux] Python reports: Python 3.13.11 Now, we come to perl. Perl reports this: " This is perl 5, version 42, subversion 2 (v5.42.2) built for x86_64-linux Copyright 1987-2026, Larry Wall Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 5 source kit. Complete documentation for Perl, including FAQ lists, should be found on this system using "man perl" or "perldoc perl". If you have access to the Internet, point your browser at https://www.perl.org/, the Perl Home Page. " So perl is super-verbose. Probably due to history. My first recommendation would be for perl to be as short as ruby and python here; mostly just to report the version itself, and if you really want to add some compiler flag or something, ideally in (). At the least that would be my recommendation. Python is best here; ruby is also ok. Perl is a bit verbose. But this is not why I report this here actually. When I capture the output of "perl version" via ruby, I get this String: "\nThis is perl 5, version 42, subversion 2 (v5.42.2) built" And so forth. Notice that specifically a newline is used here as the very first token/character. This in turn led to my script having to account for that. Usually my script assumes that the version string is on the very first line; many programs do not follow this scheme, but about 95% of all programs on a LFS/BLFS system (e. g. linux from scratch) do use that scheme. It is not a big issue to deal with that in my script, of course; I just check if the first token is a \n newline and if so I remove it - problem solved. But still I believe that this may not be necessary. Is there a reason for the leading newline? If not then perhaps it can be removed anyway. Or, as suggested, to also be as short everywhere else. I am not sure how much Larry Wall is still involved with perl, but perhaps there should be more "streamline" decisions to be made in general. Granted, the above is a super-tiny issue, if it is one at all, but I mean this more in regards with perl in general. For instance, the configure-way perl uses is also strange; both python and ruby use a much simpler and IMO more logical way to configure itself. I believe perl should be more bold when it comes to simple decisions in general, but this is an aside - the TL;DR is to propose here that the leading \n newline in --version output is removed. Unless there is a compelling reason why a newline must be there.
15 条评论