Try Perl6Beta

Got 15 Minutes? Give Perl6 a shot right now!

Perl6 is a programming language 10 years in the making.

Try out Perl6 in the prompt on the right. In addition to Perl6's methods, the following commands are also available:

  • start Start the 15 minute tutorial.
  • clear Clears the screen.
  • next Go to the next Lesson
  • back Go to the previous Lesson
Using the Prompt

The window to the right is a Perl6 prompt.

Here you can write a line of code and watch it run!

For your first bit of Perl6, try typing some math, like: 13 + 4 or 19 / 3

More Math

Great you just did some math!

Perl6 recognizes numbers and mathematics operators.

Try some more math.

  • 5 / 2
  • 2 * pi
  • 79**21

When you're finished experimenting, type next to move on the next lesson.

Inspecting Types

Values know types. You can inspect what type something is by calling *.WHAT on it

Let's see some examples:

  • say 5.WHAT
  • say pi.WHAT
  • say (5/2).WHAT
  • say (0.1 + 0.3).WHAT

Notice what type you get when you divide two integers.

Hello World!

Say 'hello' to the world in Perl6.

  • say "Hello World!"
  • "Hello World!".say
  • "Hello World!".flip

Try calling .WHAT on your quoted message: say "Hello World!".WHAT

You've just used a Perl6 String.

Strings and Things

Here are some other things you can do with Strings

  • "hello " ~ "world"
  • "hello world".chars
  • "hello world".uc
  • "HELLO WORLD".lc
  • "hello world".wordcase
To be Continued...

Oh no, looks like this tutorial is incomplete.

Feel free to play with the Perl6 REPL to the right.

Check out these examples!

  • [1,2,3] Z [4,5,6]
  • [1,2,3] Z~ [4,5,6]
  • [1,2,3] X [4,5,6]
  • sub postfix:<!>(Int $n) {[*] 2..$n;}; 6!

See Perl6.org

Powered by Docker | Made with by Syed Reza