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.

Once you have a parrot executable, check out the various types of examples on the left. Also, be sure to check out the examples directory in the parrot repository.

Example Conventions

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:

HELLO

Occasionally, additional information will be presented in red: take note!

Help! I'm stuck inside a fortune cookie factory!

Running Examples

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:
parrot foo.pir
Or, you can compile to bytecode and then run it:
parrot -o foo.pbc foo.pir
parrot foo.pbc
The Perl Onion © Copyright 2002-2008 The Perl Foundation
Site Information and Contacts
parrot