Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Teaching Perl

by logan (Curate)
on Mar 03, 2003 at 19:21 UTC ( #240129=perlquestion: print w/replies, xml ) Need Help??

logan has asked for the wisdom of the Perl Monks concerning the following question:

This weekend, a friend took me up on my long-standing offer to teach him perl. He's a network administrator who's looking to automate system tasks and develop some simple monitoring tools. I've told him several times over the past few years that perl is easy to learn and will make his life easier.

Yesterday, we sat down in front of a linux box, and I walked him through the basics: scalars, arrays, hashes, file io, system calls, subroutines, and regular expressions. In order to bolster my claim that with perl, he can do useful and interesting stuff on his first day, I showed him how he could parse interesting information out of netstat. By the time Futurama came on, he had a passable overview of how perl works, and a grip on the syntax. Most importantly, he saw how it is to get started with perl.

My friend has an overview, and he's hooked on the possibilities perl offers. He's got enough perl to start hacking together some simple scripts, I impressed upon him the need for The Camel Book and The Perl Cookbook, and suggested that he start checking out Perl Monks. I also suggested (knowing he's a music junkie) that writing tools to tag and filter his mp3s would be a great first project.

My question for the Monastary is "What next?" What should I show him next? Proper coding practice? An indepth tutorial on pattern matching? The care and feeding of CPAN? Or should I simply show him how to use MP3::ID3Lib and wait for him to return with questions?

"What do I want? I'm an American. I want more."

Replies are listed 'Best First'.
Re: Teaching Perl
by dragonchild (Archbishop) on Mar 03, 2003 at 19:47 UTC
    The key is what level is your friend at right now. For example, a programming novice would require general programming knowledge. But, a programming expert who just doesn't know Perl wouldn't need that. Once the Camel book is read and understood, your friend will, most likely, know where to go from there. Remember - you're a resource, not a director.

    We are the carpenters and bricklayers of the Information Age.

    Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.

    Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.

Re: Teaching Perl
by allolex (Curate) on Mar 03, 2003 at 20:42 UTC

    I'm afraid you're going to have to assign some homework.

    Really. If your friend knows the basics, he's going to have to get some practice. He can come up with a small project on his own and you can answer his questions. Alternatively, you can come up with an assignment yourself and then coach him along. I guess what it comes down to is you can't learn without practice.

    I think more regular expressions would be a good topic to cover from where you left off. They're so useful and even if he doesn't end up sticking with Perl, he can use that knowledge for a wagonload of other tools. (OK, maybe more like a bushel.)

    Good luck to you and your friend. I've got to get back to practicing. The projects just keep coming...


    Need to preview more...

Re: Teaching Perl
by Marza (Vicar) on Mar 03, 2003 at 21:16 UTC

    I would quiz him on his work setup. Find something that would make his life easier and make him go about doing it.

    One of the most interesting learning experiences involved automating our anti-virus setup. We where hit bad Code Red and it was all over the place(a rather long story).

    We needed a report as to the software levels, if software was installed, and the dictionary levels of all machines. We also needed to know current alerts and current levels of the dictionary files.

    This process introduced me to TieRegistry, TableExtract, HTTP::Request, LWP::UserAgent, Net::SMTP, MAIL::Sender, and IO::File. After all that; my horizons changed dramtically and ideas on things to try kept appearing.

    It's the old saying: Learn by doing!

Re: Teaching Perl
by Anonymous Monk on Mar 04, 2003 at 01:14 UTC
    Have you taught him debugging yet? :-)

    Infect your friend with the way of thinking that
    Perl carries with it, thats the most invaluable tool
    your friend can get out of this. Even more important
    than the language.


      Yep, I showed him how to print a variable to get it's value, and I showed him -c and -d. Thing is, I only gave him the overview. Assuming there's a second lecture (sermon? Nahhh, let's not pursue the Monk metaphor), I'll need to pick one thing and go into it in more depth. At this point, I'm leaning towards helping him write a simple script to parse netstat into name=value pairs and either writing the data to a logfile, mailing it somewhere, or posting it to a web page.

      One thing I addressed, independent of perl syntax, was that tools should have similar interfaces, reporting mechanisms and output formats. That way, an eventual toolsuite can grow without having to reinvent the wheel, and the code is more maintainable.

      "What do I want? I'm an American. I want more."

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (6)
As of 2022-05-21 09:24 GMT
Find Nodes?
    Voting Booth?
    Do you prefer to work remotely?

    Results (76 votes). Check out past polls.