Hello World



One usually starts by saying something to the audience.
We do this using the 
say
 keyword.
Not only does it print to the screen it also adds a newline at the end of the string.
As you can see strings are marked by " at both their ends.
Commands end with ;
examples/intro/hello_world.p6
#!/usr/bin/perl6
use v6;

say "Hello Perl 6 World";

The same in OOP style:

examples/intro/hello_world_oop.p6
#!/usr/bin/perl6
use v6;

"Hello World".say;


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: