Prev: Intro

Hello World

The print() is the same as in Perl 5 but there is a shorter way using say(). That will probably be more common in the future as it also appends a newline at the end of the values it prints. (Actually Perl 5.10 already has this feature)
use v6;

# Perl 5: print
# Perl 5.10: say

# Perl 6: print still works and there is say()
# just like in 5.10 adding a newline automatically

print "Hello World\n";
say "Hello World";      

Prev: Intro

Table of Contents


In the comments, please wrap your code snippets within <pre> </pre> tags and use spaces for indentation.
comments powered by Disqus

Perl 6 Tricks and Treats newsletter

Register to the free newsletter now, and get updates and news.