in reply to
How to Teach Perl to Scholars in the Humanities
You won't be able to give them a useful introduction to Perl in one hour.
But that's a good thing, because it frees up a whole hour for you to give them something much more valuable: an appreciation of the language.
Here's what I'd do, if I were giving your talk:
- Write a couple of scripts that they would find useful. Stuff that solves real problems they face everyday. They don't have to be huge problems...sometimes automating a repetitive niggle can be more valuable in terms of the cumulative time and frustration saved.
- Demonstrate those scripts. On real data. Or at least on plausible data.
- Then show them how some of the scripts work. Go through one or two of the scripts. Point out how "naturally" they read (and make sure they do read naturally!) Work through the copious and meaningful comments. Demonstrate the clever decomposition of the task into obvious and easily grasped subroutines.
- Suggest some resources in case they'd like to learn more. Books, the Perl documentation, Perl Monks, CPAN, etc. In particular, briefly show them some of the existing text-extraction and language-related modules on CPAN.
- Leave plenty of time for questions. Encourage the scholars to discuss the problems they need to solve, then outline (very generally) where and how Perl might help them solve those problems. If a particularly simple problem is put forward, solve it on the spot (and, if that idea appeals to you, don't hesitate to "plant" someone in the audience to propose a prearranged problem!)
Personally, I'd probably steer clear of all but the simplest regular expressions (e.g. nothing more complex than m/Mac[a-z]*/gi
) , since Perl 5 regex syntax is scary even to many experienced programmers.
And I guess if I were giving the talk, since they're presumably language scholars I'd probably finish off by showing them one of the scripts translated into Latin.
But that'd just be showing off, and certainly not necessary to the success of the presentation. ;-)