<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    Hello Perl Mongers,<br>
    <br>
    Firstly, we had yum beers last night and <i>des frites</i>. Ahhh!<br>
    <br>
    The next two pubs have been chosen - Nick selected The Moon &amp;
    Six Pence for February, and I've plucked out The Lucky Shag at
    Barrack Street Jerry for March; see the <a class="moz-txt-link-freetext" href="http://perth.pm.org/">http://perth.pm.org/</a> site
    for the calendar (unless you've already imported it into your own
    calendaring software). I'd like to get the next pub afte that chosen
    too - suggestions? Preferably with good transport (parking, rail)
    and reasonably central across the metro area.<br>
    <br>
    <br>
    <br>
    So last night we read up on the Perl 5 to Perl 6 doco, and with the
    help of Parrot and Radoku Star, tried the examples out and varied
    them a bit to see what's new. It was good; exceptions happen and are
    caught - mostly. We ended up filing one possible bug (#81682) for
    using strict types and Container aliasing (like Perl 5 references)
    that isn't handled. We only managed to get around 20 pages of the
    document read, understood, and played with - there's plenty more in
    there.<br>
    <br>
    My favourites was probably "multi sub"s - define a subroutine with
    different argument lists and/or types, and the Right One will be
    used. For example, if you define:<br>
    <blockquote><tt>multi sub add(Int $a, Int $b) { return $a + $b }</tt><br>
      <tt>multi sub add(Str %a, Str $b) { return $a ~ $b }</tt><br>
    </blockquote>
    Then calling <tt>add(5, 4)</tt> will give 9, and <tt>add("5", "4")</tt>
    will give "54". Likewise, instead of using the pre-baked types (Int,
    Str, Rat (rational/float), etc) you can also put your own types in:<br>
    <blockquote><tt>multi sub add_friend(Person $a, Person $b) {&nbsp; say
        "$a and $b are now friends" }</tt><br>
    </blockquote>
    <br>
    We played with the object class (we made a class called "Beer"), and
    inheritance from a super class ("Drink"), and multiple inheritance
    ("Vegetable"); we played with read only variables in classes (only
    can be set at instantiation), and with private variables. Defining a
    variable appears to make the variable accessible by name as a method
    call:<br>
    <blockquote><tt>class Beer {</tt><br>
      <tt>&nbsp; has $.name</tt><br>
      <tt>&nbsp; has $.retail_price</tt><br>
      <tt>&nbsp; has $!cost_price</tt><br>
      <tt>}</tt><br>
      <tt>my $drink = Beer.new( name =&gt; 'Leffe', retail_price =&gt;
        6, cost_price =&gt; 3);</tt><br>
      <tt>say "This drink is a $drink.WHAT called $drink.name";</tt><br>
    </blockquote>
    If we try and access $drink.cost_price we get an exception. This
    contradicts the Perl5 reason for private variables; as Larry Wall
    said way back then (1999 or so):<br>
    <blockquote><i>Perl doesn't have an infatuation with enforced
        privacy. It would prefer that
        you stayed out of its living room because you weren't invited,
        not because it
        has a shotgun</i><br>
    </blockquote>
    <br>
    Brackets around if() clauses are gone, arrays and hashes retain the
    same sigil (symbol) when accessing an element (@array[1] = "foo",
    not $array[1]), everything is an object (eg, $drink.WHAT as shown
    above, @array.sort), plus lots more we have yet to play with. For
    more info, see <a class="moz-txt-link-freetext" href="http://perl6.org/">http://perl6.org/</a>.<br>
    <br>
    <br>
    <br>
    So, a rather good Perl night. Can I get a volunteer to present for
    next month at all??? :)<br>
    <br>
    <br>
    &nbsp; James<br>
    PS: We found that unicode 00BD (0189, "one half", &frac12;) when multiplied
    by 2, does not equal 1. But I added that as a <i>PS</i> to the bug
    report above... :)<br>
  </body>
</html>