I downloaded the latest rakudo star and built it on Mac OS X 10.5 with gcc 4.01 supplied with xcode 3.1.4. The tests appear to pass. I then downloaded the using perl 6 book and tried the first example
use v6; my $file = open 'scores'; my @names = $file.get.split(' '); my %matches; my %sets; for $file.lines -> $line { my ($pairing, $result) = $line.split(' | '); my ($p1, $p2) = $pairing.split(' vs '); my ($r1, $r2) = $result.split(':'); %sets{$p1} += $r1; %sets{$p2} += $r2; if $r1 > $r2 { %matches{$p1}++; } else { %matches{$p2}++; } } my @sorted = @names.sort({ %sets{$_} }).sort({ %matches{$_} }).reverse +; for @sorted -> $n { say "$n has won %matches{$n} matches and %sets{$n} sets"; }
on the input
Beth Ana Charlie Dave Ana vs Dave | 3:0 Charlie vs Beth | 3:1 Ana vs Beth | 2:3 Dave vs Charlie | 3:0 Ana vs Charlie | 3:1 Beth vs Dave | 0:3
The following error is generated upon running the program:
Method 'split' not found for invocant of class '' in <anon> at line 12:type.p6 in main program body at line 1
I've tried both retyping the code and directly copy-pasting from the book and the same results are observed. Has anyone successfully run the code in the book. I'm not sure if this is an issue specific to my build, or if there is a mistake in the code in the book. Thanks, Dana

In reply to using perl 6 book trying first example by reedx032

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.