<?xml version="1.0" encoding="windows-1252"?>
<node id="91105" title="My day with Damian Conway" created="2001-06-24 19:01:13" updated="2005-08-13 12:41:23">
<type id="120">
perlmeditation</type>
<author id="72812">
petdance</author>
<data>
<field name="doctext">
 &lt;P&gt;On Saturday, June 23rd, 
[http://www.conway.org|Damian Conway] 
had a little free for all free-for-all workshop that
he gave at 
[http://www.cod.edu|College of DuPage] in Wheaton, IL.

He talked about a ton of different Perl topics, all of
them enlightening.
He's a great speaker, and I wish I could have gone to the 3-day class that
he gave earlier in the week.

Here are some random notes of interestingness that 
I scribbled down.  Perhaps
[frag] will want to add some of his own comments.


&lt;UL&gt;
&lt;LI&gt;&lt;STRONG&gt;&lt;A NAME="item_%22%24%2F_tells_when_to_stop_reading%22"&gt;``&lt;CODE&gt;$/&lt;/CODE&gt; tells when to stop reading''&lt;/A&gt;&lt;/STRONG&gt;&lt;BR&gt;

We all know about the &lt;CODE&gt;$/&lt;/CODE&gt; variable, but a new light dawned when Damian said
``&lt;CODE&gt;$/&lt;/CODE&gt; tells when to stop reading''.  That's why &lt;CODE&gt;$/ = undef&lt;/CODE&gt; makes Perl read
an entire file: There's no definition of when to stop reading.
How clear it is now.
&lt;P&gt;&lt;/P&gt;
&lt;LI&gt;&lt;STRONG&gt;&lt;A NAME="item_Perl_6_may_have_the_%2E%2E%2E_operator"&gt;Perl 6 may have the &lt;CODE&gt;...&lt;/CODE&gt; operator&lt;/A&gt;&lt;/STRONG&gt;&lt;BR&gt;

Perl 6 may have the &lt;CODE&gt;...&lt;/CODE&gt;, which Damian pronounced as the ``yada yada yada operator.''
You'd use it as a placeholder for undefined code like so:
&lt;PRE&gt;
        sub mangle {
                ...
                return 1;
        }
&lt;/PRE&gt;
&lt;P&gt;Yes, that's a literal &lt;CODE&gt;...&lt;/CODE&gt;.
Executing &lt;CODE&gt;mangle()&lt;/CODE&gt; would have Perl kick out a message like ``sub mangle is pending
future code''.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;LI&gt;&lt;STRONG&gt;&lt;A NAME="item_Typeglobs"&gt;Typeglobs&lt;/A&gt;&lt;/STRONG&gt;&lt;BR&gt;

``Typeglobs are like a box of chocolates'', he said, and then explained why in a
way that let me finally understand the method behind the madness of typeglobs.
Of course, typeglobs are going away in Perl 6.
&lt;P&gt;&lt;/P&gt;
&lt;LI&gt;&lt;STRONG&gt;&lt;A NAME="item_Perl%27s_phases"&gt;Perl's phases&lt;/A&gt;&lt;/STRONG&gt;&lt;BR&gt;

Big discussion of Perl's 5 phases: BEGIN, CHECK, INIT, execution and END, and
when you'd want to use which one.
&lt;P&gt;&lt;/P&gt;
&lt;LI&gt;&lt;STRONG&gt;&lt;A NAME="item_The_benefits_of_golf"&gt;The benefits of golf&lt;/A&gt;&lt;/STRONG&gt;&lt;BR&gt;

He didn't specifically explain that golf in the extreme 
way we golf here is good,
but rather that
``The fewer characters you type, the fewer characters you can get wrong.''
He claims that there's a linear correlation between the number of characters
in a system's source code and how many bugs it has.
&lt;P&gt;&lt;/P&gt;
&lt;LI&gt;&lt;STRONG&gt;&lt;A NAME="item_Qualifiers%2C_not_control_structures"&gt;Qualifiers, not control structures&lt;/A&gt;&lt;/STRONG&gt;&lt;BR&gt;

In this code
&lt;PRE&gt;
        foreach ( @foo ) {
                whack($_);
        }&lt;/PRE&gt;
&lt;P&gt;the &lt;CODE&gt;foreach&lt;/CODE&gt; is a control structure.&lt;/P&gt;
&lt;P&gt;In this code:&lt;/P&gt;
&lt;PRE&gt;
        whack($_) foreach @foo;&lt;/PRE&gt;
&lt;P&gt;the &lt;CODE&gt;foreach&lt;/CODE&gt; is a ``qualifier'', which is why you can't apply it to a block in
that syntax.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;LI&gt;&lt;STRONG&gt;&lt;A NAME="item_Perl_optimizes_a_lot"&gt;Perl optimizes a lot&lt;/A&gt;&lt;/STRONG&gt;&lt;BR&gt;

The Perl pseudocode has no &lt;CODE&gt;if&lt;/CODE&gt;s in it.  Anywhere.
``How can that be?'' I asked.  He then showed the following reduction:
&lt;PRE&gt;
        if ( $x &amp;gt; 50 ) {
                do_something();
        }&lt;/PRE&gt;
&lt;P&gt;is the same as&lt;/P&gt;
&lt;PRE&gt;
        ($x &amp;gt; 50) &amp;amp;&amp;amp; do_something();&lt;/PRE&gt;
&lt;P&gt;It's all just a lot of booleans in there.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;LI&gt;&lt;STRONG&gt;&lt;A NAME="item_The_use_of_the_v_notation"&gt;The use of the &lt;CODE&gt;v&lt;/CODE&gt; notation&lt;/A&gt;&lt;/STRONG&gt;&lt;BR&gt;

Version strings are tracked with the &lt;CODE&gt;v&lt;/CODE&gt; notation, like &lt;CODE&gt;v5.6.0&lt;/CODE&gt;, which gives
a string equivalent to &lt;CODE&gt;chr(5).chr(6).chr(0)&lt;/CODE&gt;.  This is also handy for IP
addresses, as in &lt;CODE&gt;v127.0.0.1&lt;/CODE&gt;.
&lt;P&gt;&lt;/P&gt;
&lt;LI&gt;&lt;STRONG&gt;&lt;A NAME="item_Attributes"&gt;Attributes&lt;/A&gt;&lt;/STRONG&gt;&lt;BR&gt;

Big discussion of attributes and the Attributes::* modules, most of which I didn't
note because I don't see any direct application for them in my work.  However,
        Perl 6 is going to make a LOT of use of attributes.
&lt;P&gt;&lt;/P&gt;
&lt;LI&gt;&lt;STRONG&gt;&lt;A NAME="item_Object%2Doriented_design"&gt;Object-oriented design&lt;/A&gt;&lt;/STRONG&gt;&lt;BR&gt;

He presented his Spinal Tap-style list of
[91080|Ten criteria for object-oriented design].  This list
will eventually be part of the standard Perl distro.

&lt;P&gt;&lt;/P&gt;
&lt;LI&gt;&lt;STRONG&gt;&lt;A NAME="item_What%27s_coming_in_Perl_6"&gt;What's coming in Perl 6&lt;/A&gt;&lt;/STRONG&gt;&lt;BR&gt;

Since Damian is sort of Larry's right hand man for language design issues, he's on
top of all the changes that are going to be coming.  Some of my favorites:
&lt;UL&gt;
&lt;LI&gt;&lt;STRONG&gt;&lt;A NAME="item_Here_document_improvements"&gt;Here document improvements&lt;/A&gt;&lt;/STRONG&gt;&lt;BR&gt;

Here documents won't have to be flush left.
&lt;PRE&gt;
    while ($foo) {
        for ( @list ) {
            print &amp;lt;&amp;lt; &amp;quot;END&amp;quot;;
                Here's the text of the message I want to print.
                Note that I'm not flush left like I would have
                to be in Perl 5.  The amount of whitespace before
                the terminating &amp;quot;END&amp;quot; is stripped from the front
                of each line.
                END
            } # for
    } # while&lt;/PRE&gt;
Many of us literally applauded and cheered.
&lt;P&gt;&lt;/P&gt;
&lt;LI&gt;&lt;STRONG&gt;&lt;A NAME="item_Typeglobs_go_away"&gt;Typeglobs go away&lt;/A&gt;&lt;/STRONG&gt;&lt;BR&gt;

Everything will still be in symbol tables, but not as they are now.  The fully
qualified name of &lt;CODE&gt;$foo&lt;/CODE&gt; will be the key in the symbol table, not like it is
now, where &lt;CODE&gt;$foo&lt;/CODE&gt; really means ``the scalar in the &lt;CODE&gt;foo&lt;/CODE&gt; typeglob''.
Also, lexical variables go into their own special symbol table &lt;CODE&gt;MY&lt;/CODE&gt;.
&lt;P&gt;&lt;/P&gt;
&lt;LI&gt;&lt;STRONG&gt;&lt;A NAME="item_Globals_go_away"&gt;Globals go away&lt;/A&gt;&lt;/STRONG&gt;&lt;BR&gt;

All the global punctuation variables will go away or become properties of something else.
For instance, instead of setting &lt;CODE&gt;$/&lt;/CODE&gt;, you'll modify the &lt;CODE&gt;insep()&lt;/CODE&gt; attribute of the file handle
in question.
&lt;P&gt;&lt;/P&gt;&lt;/UL&gt;
&lt;/UL&gt;

And here is where my notes end.  I wish I had a videotape
of it.  He's just great.

&lt;P&gt;
xoxo,&lt;BR&gt;
Andy&lt;BR&gt;
--&lt;BR&gt;
I was dreaming when I wrote this, so sue me if I go too fast.
</field>
</data>
</node>
