title: Why do I get 'divide by zero` errors when I try to run my script with Rakudo?
body: <p>I just built Rakudo and Parrot so that I could play with it and get started on learning Perl 6.  I downloaded the Perl 6 book and happily typed in the first demo program (the tennis tournament example).</p>
  
  <p>When I try to run the program, I get an error:</p>
  
  <pre><code>Divide by zero
  current instr.: '' pc -1 ((unknown file):-1)
  </code></pre>
  
  <p>I have my <code>perl6</code> binary in the build directory.  I added a scripts directory under the rakudo build directory:</p>
  
  <pre><code>  rakudo
    |- perl6
    \- scripts
       |- perlbook_02.01
       \- scores
  </code></pre>
  
  <p>If I try to run even a simple hello world script from my scripts directory I get the same error:</p>
  
  <pre><code>#!/home/daotoad/rakudo/perl6
  
  use v6;
  say "Hello nurse!";
  </code></pre>
  
  <p>However if I run it from the <code>rakudo</code> directory it works.</p>
  
  <p>It sounds like there are some environment variables I need to set, but I am at a lost as to what the are and what values to give them.</p>
  
  <p>Any thoughts?</p>
  
  <p><strong>Update:</strong></p>
  
  <p>I'd rather not install rakudo at this point, I'd rather just run things from the build directory.  This will allow me to keep my changes to my system minimal as I try out different Perl6 builds (Rakudo * is out very soon).</p>
  
  <p>The README file encouraged me to think that this was possible:</p>
  
  <blockquote>
  <pre><code>   $ cd rakudo
     $ perl Configure.pl --gen-parrot
     $ make
  </code></pre>
    
    <p>This will create a "perl6" or "perl6.exe" executable in the
    current (rakudo) directory.  Programs can then be run from
    the build directory using a command like:</p>
  
  <pre><code>   $ ./perl6 hello.pl
  </code></pre>
  </blockquote>
  
  <p>Upon rereading, I found a reference to the fact that it is necessary to install rakudo before running scripts outside the build directory:</p>
  
  <blockquote>
    <p>Once built, Rakudo's <code>make install</code> target will install Rakudo
    and its libraries into the Parrot installation that was used to
    create it.  Until this step is performed, the "perl6" executable
    created by <code>make</code> above can only be reliably run from the root of
    Rakudo's build directory.  After <code>make install</code> is performed,
    the installed executable can be run from any directory (as long as
    the Parrot installation that was used to create it remains intact).</p>
  </blockquote>
  
  <p>So it looks like I need to install rakudo to play with Perl 6.</p>
  
  <p>The next question is, where rakudo be installed? README says into the Parrot install used to build.  </p>
  
  <p>I used the <code>--gen-parrot</code> option in my build, which looks like it installs into <code>rakudo/parrot-install</code>.  So rakudo will be installed into my <code>rakudo\parrot-install</code>?  </p>
  
  <p>Reading the Makefile, supports this conclusion.  I ran <code>make install</code>, and it did install into <code>parrot_install</code>.</p>
  
  <p>This part of the build/install process is unclear for a newbie to Perl6.  I'll see if I can up with a documentation patch to clarify things.</p>
  
  <p>Off the top of my head:</p>
  
  <ol>
  <li><p>Emphasize running <code>make install</code> before running scripts outside of build.  This requirement is currently burried in the middle of a paragraph and can be easily missed by someone skimming the docs (me).</p></li>
  <li><p>Explicitly state that with <code>--gen-parrot</code> will install perl6 into the <code>parrot_install</code> directory.</p></li>
  </ol>