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";      


Copyright 2006, 2007, 2008, 2009, 2010 Gabor Szabo http://szabgab.com/ Index | TOC
If you are interested in on-site trainings by the author, please contact me directly.

Online courses:

Would you like to get
updated when I publish
the next article?

Follow me:

Google Plus Twitter RSS feed