in reply to strange responses to inhouse perl training

I agree with the other posters and would start with hashes etc (say, how to count all unique words in a file. How to find the line numbers of all unique words in a file.)

One thing I'd add is a three minutes overview of what CPAN is. Mention how easy it is to use and that it is the extensive public library that is the Standard, which other languages try to reach. (Show -- don't teach -- a list of example modules. E.g. Inline, Mechanize, treating text files as an array of lines, etc.)

Also tell them the books to start with.

Update: What I tried to say -- you should (a) give the students an idea of the next step and (b) show them some powerful uses which are simple to implement.

  • Comment on Re: strange responses to inhouse perl training

Replies are listed 'Best First'.
Re^2: strange responses to inhouse perl training
by Cody Pendant (Prior) on Aug 24, 2006 at 07:00 UTC
    I agree about the CPAN thing.

    Perl's a programming language. They've seen programming languages before, they'll see them again.

    But I bet they have no idea how enormous CPAN is and all the weird and wonderful stuff that's in it.

    Taking something like Lingua::EN::Sentence for instance.

    Throw this question out to the class --

    What's a sentence? Anything up to a full stop? Nope, not good enough. Anything up to a full stop followed by a space?

    Maybe ... maybe not. ^^
    OK then, full stop, space, uppercase letter? I'll ask
    Mr. Jones ^^^
    if he thinks that's smart enough an algorithm. He works for
    I.B.M. I think. ^^^

    "Wow, that's a lot harder than it looks."

    Oh yes and we forgot about quotes, question marks and exclamations.

    The point of all this being that someone has sat down and thought really hard about all those things for a really long time and come up with Lingua::EN::Sentence so they don't have to. Plus of course it's easily extensible in case they find something it doesn't catch.

    use Lingua::EN::Sentence qw( get_sentences ); $text = " I agree about the CPAN thing. Perl's a programming language. They've seen programming languages before, they'll see them again. But I bet they have no idea how enormous CPAN is and all the weird and wonderful stuff that's in it. Taking something like Lingua::EN::Sentence for instance. What's a sentence? Anything up to a full stop? Nope, not good enough. Anything up to a full stop followed by a space? Maybe ... maybe not. OK then, full stop, space, uppercase letter? I'll ask Mr. Jones if he thinks that's smart enough an algorithm. He works for I.B.M. I think. \"Wow, that's a lot harder than it looks.\" Oh yes and we forgot about quotes, questionmarks and exclamations!"; my $sentences = get_sentences($text); ## Get the sentences. foreach my $sentence (@$sentences) { print 'SENTENCE: ', $sentence, $/; }


    ($_='kkvvttuu bbooppuuiiffss qqffssmm iibbddllffss')
    =~y~b-v~a-z~s; print
Re^2: strange responses to inhouse perl training
by apotheon (Deacon) on Aug 24, 2006 at 09:34 UTC

    CPAN is useful for telling people that there are lots of great libraries that make it much easier to write complex programs that do magical things without having to write hundreds of lines of code oneself. CPAN is not something you can teach somebody about in his first-ever brush with Perl — at least, not effectively.

    First, teach enough Perl to be able to use modules without actually talking about CPAN or module use. Next, teach how to use core modules that come with your Perl distribution, because using modules is almost like using a completely different language embedded within Perl. Third, teach how to create modules. Finally, after all of this, teach people how to use CPAN.

    Get it in a different order, and you're likely to just sow confusion. That, at least, is my experience.

    For a long time, my impression of CPAN was that it was more work than it was worth. This is because I was being pushed toward CPAN before I had the knowledge basis to be able to leverage it for any positive ends. Don't let my experience be the same experience your students have.

    CPAN is an excellent resource. You're only doing someone a disservice if you introduce him or her to CPAN without first familiarizing him or her with enough Perl to be able to get any net benefit. By the same token, when you're helping someone migrate from lifelong Windows use to Linux (for instance), don't start with teaching how to compile kernel modules. Start with the installer and the package manager. Even if you believe that installing everything by compiling from tarball is the One True Way, you're going to run into real difficulty training someone unless you can find a way to teach compiling from tarball as an installation practice without taking them away from Windows first. Learning works best from within a context wherein something (almost anything) is familiar. The more that's familiar, the quicker the bits that aren't can be learned. Familiarize students with the basics before tackling the more complex stuff: teach how basic loops and variables work in Perl before tackling CPAN.

    print substr("Just another Perl hacker", 0, -2);
    - apotheon
    CopyWrite Chad Perrin