为什么 Ubuntu(20.04)没有预装 Perl?

为什么 Ubuntu(20.04)没有预装 Perl?

https://unix.stackexchange.com/questions/48018/why-is-perl-installed-by-default-with-most-linux-distributions

https://stackoverflow.com/questions/1164133/are-there-unix-platforms-where-perl-is-not-installed-by-default

我只找到了这些帖子,问题恰恰相反。我在日常使用中或在 shell 脚本中经常使用(或者我想使用)Perl,但每次它都会让我感到困惑,因为我知道为了让我的脚本工作,我首先需要安装 Perl。有人可以分享一些关于为什么 Ubuntu 会出现这种情况的信息吗?

答案1

Ubuntu 20.04已安装 Perl。
至少如果你查看 Canonical 的官方 Ubuntu docker 镜像。

tomodachi@delacroix ~ $ docker run -ti ubuntu:20.04 perl --version
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.

This is perl 5, version 30, subversion 0 (v5.30.0) built for x86_64-linux-gnu-thread-multi
(with 57 registered patches, see perl -V for more detail)

Copyright 1987-2019, 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 http://www.perl.org/, the Perl Home Page.

但由于并非在所有平台上都可用、不那么流行并且与旧版本的 Perl 不完全向后兼容,它不再被视为高级脚本的最佳选择。

如果你想要一种在未来更有可能得到全面支持的编程语言,并且能够跨发行版和操作系统进行开发,那么请关注Python或者Ansible满足您的本地 shell 脚本和自动化需求

相关内容