Running perl6

Synopsis

Please run perl6 --help to see actual options.

They are currently changing on demand, there are a lot of debug options, so keeping this document in sync is currently not worth the effort -- sorry.

Run perl6 --test for a full test run. If everything succeeds - fine. If not, read on. If you want to know more, read on ;-)

Getting started

For a quick test, if everything is ok, try a one liner:

perl6 -vwk -e'print(qq(Hello perl6\n))'

You should see the individual compilation steps and finally the output of above program.

If that fails, there are currently 2 steps that might be the culprit:

P6C -- the perl6 compiler
parrot -- the parrot interpreter

Individual steps

P6C

The perl6 compiler needs an uptodate grammar to work correctly. If you have modified the grammar in P6C/Parser.pm, you will need to make sure Perl6grammar.pm is regenerated by running

perl6 --force-grammar -e'print qq(ok\n)' -vwk

or

rm Perl6grammar.pm ; perl6 -vwk -e'print qq(ok\n)'

If this prints ok at the end, then it should be so. If not, let's look, what is broken.

The perl6 compiler spits out PIR files (parrot intermediate language), also known as IMCC files, because this was the name of the intermediate code compiler. So, after above test you should have a file named __eval__.imc in your current working directory. Have a look into it.

It should look similar to this:

.sub __main
	call __setup
	call _main
	end
	ret
.sub _main
	saveall
	$P1 = new PerlArray
	$I3 = 0
	$P1[$I3] = "ok\n"
	inc $I3
	.arg	$P1
	call	_print
	restoreall
	ret
... # more here

(Comments left out for brevity). If that's ok, we go on to:

Parrot

Parrot runs above .imc file directly with the passed options.

Let's try it manually:

../../parrot -G __eval__.imc

This turns off DOD/GC, which might be helpful to verify, that some DOD/GC bug is still lurking around.

Summary

These individual steps are currently run by the perl6 driver program. Though there are, as already shown above, some short cuts:

perl6 examples/life.p6

runs the program examples/life.p6 directly through parrot.

perl6 -Rj -v examples/life.p6

runs the program with the JIT core.

perl6 -RPd -v -k examples/life.p6

Above option -k tells perl6 to keep intermediate files. So you can run them with the appropriate command or you can run them with the perl6 driver. Flags after -R are passed on to parrot.

perl6 ../../examples/assembly/life.pasm
perl6 ../../examples/assembly/mops.pasm -Rj

DWIM.

Reporting bugs

If any of the above steps fail, please report the bug to <bugs-parrot@bugs6.perl.org> with the output of

perl6 --version

and a description of the problem. If all tests are failing, please provide the intermediate files for one of the tests by running e.g.

perl6 -wk t/compiler/{testnumber}_{subtest}.p6

If particular tests fail, please provide the test summary plus symptomatic cases of failures.

And finally, don't forget to report your OS environment including involved components like perl and C compiler.

Thanks.

AUTHOR

Leopold Tötsch <lt@toetsch.at>

$Id: debugging.pod 5342 2004-02-22 12:06:19Z leo $

1 POD Error

The following errors were encountered while parsing the POD:

Around line 134:

Non-ASCII character seen before =encoding in 'Tötsch'. Assuming CP1252