在自己的ubuntu 16.04安装了perl6,想玩一把。
一般ubuntu主机都自带了perl5。
在终端输入perl –version,打印如下:
This is perl 5, version 22, subversion 1 (v5.22.1) built for x86_64-linux-gnu-thread-multi
(with 58 registered patches, see perl -V for more detail)
Copyright 1987-2015, 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.
其实安装perl6之后perl5和perl6是可以共存的。
官网:https://www.perl6.org/ 中安装说明如下:
% wget https://rakudo.perl6.org/downloads/star/rakudo-star-2017.01.tar.gz
% tar xfz rakudo-star-2017.01.tar.gz
% cd rakudo-star-2017.01
# perl Configure.pl --gen-moar --prefix /opt/rakudo-star-2017.01
# make install
然后注意把perl6加入命令中,做法如下:
在终端输入 vi ~/.bashrc 编辑该文件:
输入:
alias perl6="cd /home/soft_file/rakudo && ./perl6"
这里你把/home/soft_file/rakudo换成你的perl6包解压目录即可。
然后source ~/.bashrc使环境变量生效。
再次在终端输入perl6 –version,打印结果如下:
This is Rakudo version 2017.01 built on MoarVM version 2017.01
implementing Perl 6.c.
说明perl6安装配置成功。