Camelia
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)
examples/p526/hello_world.p6
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

Comments

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.
Email:
Name: