Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

How to Teach Perl to Scholars in the Humanities

by cyocum (Curate)
on Jan 30, 2004 at 20:06 UTC ( #325375=perlmeditation: print w/replies, xml ) Need Help??

I am in the Celtic and Scottish studies department at the University of Edinburgh. In my former life, I was a programmer. I was contemplating showing perl off as a great way to automate searching texts, which is often what people in the Humanities do.

I have two main obsticle: first, these are non-programmers and computers often scare them; second, how do I give them a good introduction to the language in about an hour? My first idea is to go into a few of the language constructs then give them a juicy script? Some ideas would be appriciated.

  • Comment on How to Teach Perl to Scholars in the Humanities

Replies are listed 'Best First'.
Re: How to Teach Perl to Scholars in the Humanities
by TheDamian (Priest) on Jan 30, 2004 at 21:24 UTC
    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:

    1. 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.
    2. Demonstrate those scripts. On real data. Or at least on plausible data.
    3. 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.
    4. 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.
    5. 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. ;-)

    Good luck!

Re [0]: How to Teach Perl to Scholars in the Humanities
by Intrepid (Deacon) on Jan 30, 2004 at 20:49 UTC

    I am extremely excited by your ambition, while at the same time I am somewhat doubtful about the chances of its success. IMHO, the foremost hurdle you face is simply that the kind of technophobe / non-tech you want to approach (who are people like my mum, dad and so on, who are teachers in the Humanities) are allergic to the cli. To start with if you open a DOS console or term in front of them and say "you are going to be typing things in here", you will have already lost 90% of them. It's a hard fact (especially for those of us who love the cli as much as I) but rather inescapable. So what are you going to do about that?

    IMO the best measure you could take to promote use of perl by these non-tech colleagues would be to code up something of a demo program in a Perl/Tk (or other perl GUI interface like the WXPerl, iirc) wrapper. Show them the input and output and code a few controls that let them twiddle something about how it runs. Spend as much time as possible (aargh) on the GUI-face so that their first impression is of a professional-quality tool (as they perceive it).

    OTOH I may be wrong in assuming that your department doesn't have any old DOS users about (my dad first learned in DOS, now Windoze GUI baffles him). In which case (in any case, actually) your very first move probably still ought to be: show them a script at work, run it for them and let them see what it can do. Only after demonstrating something very powerful and flexible should you try to explain anything about how Perl is configured or coded up. Whether done in a text console or wrapped in a GUI, they first need to be shown what it's good for. Major selling job needs to be done on people like Humanities professors, as they have a type of technophobia that isn't just about "never learned" but is even more about "don't want to learn, my cranium is full enough (and the internal workings are likely petrified enough) as it is."

    If I can be of any help, let me know.

        Soren A / somian / perlspinr / Intrepid

    Now, 2004: The 3 least meaningful terms in online jargon are:
      troll   flame   rant
    These used to mean something; but then they were highjacked by the kind of
    inferior intellects who, when faced with a more erudite opponent employing
    superior arguments (or simply hanging in there with a disagreeable
    contention), abuse them as merely another form of name-calling.  ;-)
Props for Perl's regular expressions
by allolex (Curate) on Jan 30, 2004 at 22:58 UTC

    You've received some excellent responses here, but I wanted to tell you about about my own efforts in this area.

    I'm in the Department of Romance Philology at my University and the one thing that has gotten the linguists in our department all excited is the power of regular expressions. Regexen are central to a lot of what so many Perl programmers do with the language. As a matter of fact, Perl's regular expression support is so well-developed that many other languages and tools use "Perl compatible" regular expression engines. Regular expressions are even useful for non-programmers and lead logically into simple substitution scripts for your next step in converting your flock.

    One such program that is used often in linguistics and literature departments is Monoconc (a concordancer). Even word processors like OpenOffice Writer or Microsoft Word support regular expressions in one form or another.

    The advantage to this approach for you is that you teach them something that is immediately useful on a practical level, but which has a solid theoretical foundation, all without sacrificing necessary detail by taking a too broad approach towards introducing them to Perl.


Re: How to Teach Perl to Scholars in the Humanities
by exussum0 (Vicar) on Jan 30, 2004 at 20:27 UTC
    Well, if the goal is to teach searching with perl, giving them a tool for searching using regexp's might not hurt. Explain that e+ would mean 1 or more e's, e* would mean as many e's as possible, none is feasible.. etc..

    Once that is understood, go onto the concept of variables (and file handles) as well as functions, so that they can open and close files (for reading). finally, something on globs.

    But if they are scared, what are you trying to accomplish other than them learning? Are you trying to speed them up? The tool you give them, a language, or a page or program, isn't effective if it isn't well received.

    Play that funky music white boy..

      That's the issue. I want to break down some of those barriers and show them something useful besides. I used perl to do interesting searches of Annals of Ulster, which is a huge document and the search facilities on it leave much to be desired. I also want to show that computers can be useful tools along side the traditional tools of the Humanities.

Re: How to Teach Perl to Scholars in the Humanities
by Wally Hartshorn (Hermit) on Jan 30, 2004 at 21:23 UTC

    Teaching non-programmers Perl in an hour is an unrealistic goal. You'd be far better off in showing them the benefits of Perl, of trying to inspire them to learn more on their own, and of introducing them to some Perl resources. A one-hour crash course is more likely to scare off than attract. If you can spark their desire for knowledge, you'll have done far more good.

    Wally Hartshorn

    (Plug: Visit JavaJunkies, PerlMonks for Java)

Re: How to Teach Perl to Scholars in the Humanities
by johndageek (Hermit) on Jan 30, 2004 at 21:03 UTC
    Question, how do they search now?

    Have them find particular text using their current method, then try one of the two below.

    Of course perl needs to be on their box for the second one. But many people will gravitate toward something they are convinced is better/faster/easier than the way they are doing it now.

    if they are using unix or cygwin try
    grep -n text_to_search_for filename

    #!/usr/bin/perl ## put your file name in below $your_file="file name goes here"; ## open in, "$your_file" or die "could not open $your_file\n"; ## loops through file while (<in>) { $line_count++; ## in the line below put the text to search for between the / and / print "$line_count - $_" if (/text to find/); }

    Good luck, HTH!

Re: How to Teach Perl to Scholars in the Humanities
by Hanamaki (Chaplain) on Jan 31, 2004 at 19:36 UTC
    You allready got some good advice above, but let me give some more hints, how to talk about perl in a humanistic environment.

    Since it is the department of Celtic and Scottish studies, I assume that the people in this department have a linguistic and literature background.
    The linguists are pretty easy to handle. Just speak there language and you can tell in a few minutes a lot of Perls power. Linguists know the Chomsky hierarchy as programmers know. So if you talk about RegEx, talk about regular grammars . Some of them may even know about the current finite-state boom in language parsing (dangerous ground if you talk to guys of the old school) and may get interessted if you tell them that regular expressions are a language to write finite state machines, which are for e.g. very often used in computational morphology. Another example are hashes. Try to explain hashes from the viewpoint of the cognitive science Schema Theory and so forth.

    So after this theoretic part you could talk about the ease implementing corpus tools. The Web as corpora is another quit booming topic. To use the web you need tools like spiders to get the data, and n-gramm or whatever scripts to compute them. It won't harm to use the word scripts, instead of programms, because its a word they should allready know since this term is a joint development of computer science and cognitive psychology coined in the late 70s, and well known in athropology and linguistics. Probably script does not sound as scary as programm.

    Many people in the humanties are stilled scared about computers, but also know, that there is a shift to computer assisted research. In our days researchers don't spend there whole life counting the "the", "that" and "this" in the literature from 1600 to 1800. So, while they may fear computers, many will feel the need to get aquainted to them. So just tell them, programming is hard, but Perl gives you enough sugar to swallow this bitter pill in a human way.

Re: How to Teach Perl to Scholars in the Humanities
by Anonymous Monk on Jan 30, 2004 at 20:29 UTC
    I suggest you don't try to teach them perl, but rather teach them to install and configure perlfect

      Thanks for the information. I will give it a shot to see if that will work. You may want to read my node on indexing. Many indexers only tell you if something is in a file not where in that file it is. That is useless to a person in the Humanities when a text file is often 600K+, as I point out in that node.

      Agreed. Try to teach those poor souls regex and their eyes will roll right back in their heads. A "normal" search engine (with its boolean logic AND, OR, NOT) will be quite enough of a logical stretch for them. Of course you could always hack up the equivalent of KRAUT or JIVE or "Swedish Chef" as a down and dirty translator if you really want to get their attention :-)

      Have you actually ever used Perlfect, or are you just recommending it because it's free and has a pretty box on the site? If you've used it, it's crap. If you've looked at the source, you'll have nightmares.

      Know what you're recommending before you recommend it.

Re: How to Teach Perl to Scholars in the Humanities
by waswas-fng (Curate) on Jan 30, 2004 at 23:17 UTC
    One thing you may want to pass on during this conversation is the way computers can make some big problems small (count the number of times "the" is followed by "tree" or "car" in a very large text.) and where small problems can become large (what does that sentence actually mean, does it have different meanings?). You may find that non techie people assume that computers can solve any problem. It is just not true, there is something to be said for the rounding errors that happen in human brains.

Re: How to Teach Perl to Scholars in the Humanities
by injunjoel (Priest) on Jan 30, 2004 at 21:31 UTC
    Greetings All,
    A very interesting and ambitious task to say the least! Though not impossible. I would first research a common problem or task that your Humanities colleagues encounter on a regular basis (you mentioned searching texts). Then write up an example situation and code a script to deal with it, focus on an easy UI and perhaps give it a web interface. This way you have a palatable example (that is easy to use) to show while you proselytize Perl.
    If you somehow keep their attention then I would focus on logical comparisons and loop constructs to illustrate that what we do as programmers is not magic, just meticulous... help demystify the syntax (which I find most students get caught up on). This is assuming you are trying to get them to program as well, if not field questions.
    Seeing as these are Humanities people Iím thinking you would be better off writing some software for them to deal with their problems rather than attempting to teach them how to program. Just keep your audience in mind. I tutored children with Autism for a while as well as taught an experiment based after school seminar in science for 2-5th graders and keeping in mind the fact that your audience is not as educated, in whatever field you are teaching, as you are is important (this mostly applies to field specific vocabulary, but concepts as well). I would try your presentation out on someone you know that is not tech savvy first.
    Hope that helps... a bit.
Re: How to Teach Perl to Scholars in the Humanities
by williamp (Pilgrim) on Jan 30, 2004 at 21:11 UTC
    Hi, It sounds to me like you want to "sell" the idea of using Perl to these guys. As such talk it terms of benefits, show them what they can get from using it. Once they have realised the benifits they can get from it they will want to learn the details.

      >>To start with if you open a DOS console or term in front of them and say "you are going to be typing things in here", you will have already lost 90% of them. It's a hard fact (especially for those of us who love the cli as much as I) but rather inescapable. So what are you going to do about that?<<

      Maybe you could start by writing a small script which teaches maybe three simple text functions and concepts. Finding a specific line/word (how to use find), searching for similar words (simple regexp), and then maybe printing the results to a file. Or something else which is more useful for you.

      Maybe your perl script could run on a web page and you could take user input for the functions, and vet the responses. You could decide whether you would actually want to run the user inputted code or not... could increase interactivity (and the work for you).

      Such a script would be some work to write, but perhaps requires more thought than complex coding.

      I agree with that when you start by making the tools too cumbersome, you lose your students even before you can show them anything useful. When I learned programming (back in 5th grade!) the teacher set up our Basic interface for us... but the concepts still stuck. Convey the utility, hopefully all else will follow. Probably the lesson won't stick for everyone, but maybe some people will be willing to dig around a bit more, and then you can come back and wonder what to do next.

      (Funny, we were just having a conversation about teaching perl over in the meditations section. But I haven't figured out how to link to that node yet... ;| sorry, newbie.)

Re: How to Teach Perl to Scholars in the Humanities
by TomDLux (Vicar) on Jan 31, 2004 at 03:06 UTC

    They won't learn Perl however wonderful a language it may be.

    However, they will rush to learn the language if it does something they need, and don't have available elsewhere.

    After all, we all have a limited time, and have to make choices about how to allocate it.


Re: How to Teach Perl to Scholars in the Humanities
by Theo (Priest) on Feb 01, 2004 at 05:56 UTC
    Your first task is to examine your own motives.
    - Are you trying to help these people get their work done faster & better?
    - Are you trying to spread the use of perl?
    - Are you trying to impress others?
    - (append large list)

    If not the first choice, then you'd probably have better success teaching pigs to sing. If your first & highset goal is to help them, whip up some scripts that solve some of their real world problems, as others before me have pointed out, and let it go. If you get one or two people who see the power of the language and want to persue perl further, count that as a bonus (but don't expect it).

    If you do a good job on the scripts, you'll be remembered by most of them as the guy who made their lives much easier.

    (so many nodes and so little time ... )

Re: How to Teach Perl to Scholars in the Humanities
by MCS (Monk) on Jan 31, 2004 at 21:31 UTC

    Well you've already got a lot of replies but I'll offer my suggestions. (as I know a lot of these humanity types)

    First many of them will resist the move to computers because they are scared of them. You cannot change this in 1 hour. The length of time it takes is different for each person but it will take a lot longer than 1 hour to get them comfortable with a computer.

    My first suggestion would be to write some utilities that they can use. Make sure it is EASY to use! Then if a few people are comfortable using your utilities and want to take it to the next level (modifying it to suit their purposes) help them out but don't push them. Leave "Mastering regular expressions" on your desk (or bookshelf) and maybe lend it out to whoever is interested.

    Start slow, ease them into it and above all make sure they are comfortable and that you aren't pushing them. Instead of taking an hour to teach them perl, take an hour to teach them how to use a script that you wrote or something. Take an hour to show them how to search the internet better with something like google first.

    You have to learn to crawl before you can walk. While some of these people may be very smart in their field, if they are uncomfortable using computers, a one hour seminar will not teach them perl. Good luck in whatever you decide to do.

Re: How to Teach Perl to Scholars in the Humanities
by cyocum (Curate) on Jan 31, 2004 at 00:48 UTC

    These are all execptionally fine comments but as I have just returned from the pub I will address these tomorrow. Again, thank you very much!

Re: How to Teach Perl to Scholars in the Humanities
by hsmyers (Canon) on Jan 31, 2004 at 16:20 UTC
    There is a long standing association with journal, read about it here And you might want to introduce them to Lingua::Romana::Perligata as well. After all it might be fun to suggest a Lingua::Celtae::Gaelic::Scots or somesuch.


    "Never try to teach a pig to wastes your time and it annoys the pig."
Re: How to Teach Perl to Scholars in the Humanities
by xenchu (Friar) on Feb 05, 2004 at 00:06 UTC

    This is probably too late to make any difference and might not, for any number of reasons be feasible, but I thought I would mention it. I am a little surprised that no one else has suggested it.

    Why not offer to teach your colleagues' serfs..ah, graduate students Perl? This could have several advantages. First, having someone else do the work is often attractive especially if the work is seen as distasteful. And you might point out that those same advisors would receive the immediate advantage from the Perl the graduate students learn and use. Secondly, if ordered by their advisor to learn Perl the graduate students probably couldn't say no. Thirdly, being younger, graduate students are less likely to have technophobia and be much more familiar with computers and programming. And lastly, if the graduate students do learn Perl and start to get significant research results, then it will probably occur to at least some of those professors that they are missing a significant advantage in their own research efforts.


    The Needs of the World and my Talents run parallel to infinity.
Re: How to Teach Perl to Scholars in the Humanities
by cyocum (Curate) on Feb 01, 2004 at 20:01 UTC

    Thank you all again. I was ill the last few days so I have not been able to get back to you all. I will take a look at all the great suggestions and let you guys know how it turned out. Thanks again!

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlmeditation [id://325375]
Approved by barrd
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (2)
As of 2022-06-25 04:53 GMT
Find Nodes?
    Voting Booth?
    My most frequent journeys are powered by:

    Results (81 votes). Check out past polls.