I am eager to learn Raku(Perl 6) and its syntax.
I already have Perl 5 installed in my Ubuntu machine.
vinod@ubuntu-s-1vcpu-1gb-nyc1-01:~$ perl -v
This is perl 5, version 26, subversion 1 (v5.26.1) built for x86_64-linux-gnu-thread-multi
(with 67 registered patches, see perl -V for more detail)
Copyright 1987-2017, 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.
I want to install Raku in the same Ubuntu system. I have couple of questions:
use Perl 5.26;
at the beginning? By default which version of Perl it will take?$ sudo apt-get install rakudo
[ ... stuff happens ... ]
$ perl6 -v
This is Rakudo version 2018.03 built on MoarVM version 2018.03
implementing Perl 6.c.
$ perl -v
This is perl 5, version 26, subversion 1 (v5.26.1) built for x86_64-linux-gnu-thread-multi
(with 67 registered patches, see perl -V for more detail)
The Raku compiler is in a package called rakudo
. That package includes a program called perl6
which is the actual Raku compiler. The Perl compiler and the Raku compiler are two completely separate programs, so there is no problem having them both installed and running code using either of them. They are as separate as Perl and PHP.
Update: In a (now, bizarrely, deleted) comment, you asked
What was the way to open a vi editor and write a code in that
You do it in exactly the same way as you would do it for any programming language where the code is compiled or interpreted on each execution - Perl, Python, Ruby, bash, they all work the same way.
You can write a text file containing Raku code and run it with perl6 your_file_name
.
Or you can put the correct shebang line (which is #!/usr/bin/perl6
) at the top of the file and make the file executable with chmod +x your_file_name
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With