Before you can run any examples, you'll need to download the latest version of Parrot. If you don't have a compiler, some binary packages are available.
As you read through the examples, you'll see the following typographic conventions:
Code snippets will appear in blue:
10 PRINT "HELLO"
Expected output will appear in green:
Occasionally, additional information will be presented in red: take note!
Help! I'm stuck inside a fortune cookie factory!
For all of the examples, you can save the code in a file (PIR examples use a .pir suffix, PASM examples use a .pasm suffix.). Then you can either run the sample directly:
Or, you can compile to bytecode and then run it:
parrot -o foo.pbc foo.pir parrot foo.pbc