Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

A reasonable approach to getting a Perl skill foundation?

by mikeraz (Friar)
on Apr 04, 2012 at 15:35 UTC ( #963465=perlquestion: print w/replies, xml ) Need Help??
mikeraz has asked for the wisdom of the Perl Monks concerning the following question:

On April 13th I will be, as they say, between jobs.1 I'm leaving behind a collection of Perl based programs and co-workers with little to no Perl knowledge.

In an email to my current boss I'm suggesting he assign people to read and do every exercise in Learning Perl and Learning Perl Student Workbook. I'm asserting that after having completed all the exercises the workers will have at least a foundation in Perl and the ability to (hopefully) understand the code I'm leaving them. I'm also asserting this can be done in three weeks by "learning" a chapter a day.

Is this reasonable?
Do you have other recommendations?

1 This is the good kind of "between jobs" where I start with a new department doing more interesting work on the following Monday.

Be Appropriate && Follow Your Curiosity
  • Comment on A reasonable approach to getting a Perl skill foundation?

Replies are listed 'Best First'.
Re: A reasonable approach to getting a Perl skill foundation?
by davido (Archbishop) on Apr 04, 2012 at 16:48 UTC

    Learning Perl doesn't cover references, packages, and objects. You might suggest the six-week version that includes Intermediate Perl, for just that reason. I suspect your code does include refs at least.

    Another thought... why not offer to come back twice a week for six weeks to teach a course. Could be paid, or could be in return for a nice letter of recommendation, or both. Plus, you could then add "training" to your own resume.


      Ooops. I use references a bit. And in one case (XML tree traversal via XML::Simple) some deeply nested data structures.

      No class opportunity - if need be they'll wander over to my new cube and ask. I'm not changing companies, just jobs.

      Be Appropriate && Follow Your Curiosity
Re: A reasonable approach to getting a Perl skill foundation?
by CountZero (Bishop) on Apr 04, 2012 at 19:13 UTC
    And tell them all to become members of Perlmonks! (with the strict instruction to upvote at least one of your nodes each day).


    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

    My blog: Imperial Deltronics
Re: A reasonable approach to getting a Perl skill foundation?
by jeffa (Bishop) on Apr 04, 2012 at 16:12 UTC

      Modern Perl for a raw beginner? y'ok,

      PBP I'd recommend for after they make it through the basics. So, yeah.

      Be Appropriate && Follow Your Curiosity
        Modern Perl for a raw beginner?

        Modern Perl: the book works best for people who've programmed something before. Someone who's never used a text editor and run "Hello, world!" before will struggle at the start.

Re: A reasonable approach to getting a Perl skill foundation?
by pemungkah (Priest) on Apr 04, 2012 at 18:04 UTC
    I recommend the Perl Cookbook over PBP. It has working code examples, classified by "how do I do", which is a great way to get up to speed fast. I have been doing a lot of Python support lately, and this is always the kind of thing I'm looking up (though online; a copy of the Python Cookbook would probably be saving me time as well): "how do regex matches work again?" or "what's the best way to read a file backwards?" and so on.

    Stack Overflow is also an invaluable resource for this kind of thing.

Re: A reasonable approach to getting a Perl skill foundation?
by eyepopslikeamosquito (Chancellor) on Apr 04, 2012 at 22:39 UTC

    Apart from learning a new language, don't forget that you are leaving your workmates, and those who follow them, a long term code maintenance burden. Even if they learn Perl well, they may struggle to trouble-shoot production problems with your code, especially if they must be fixed urgently. Accordingly, you should consider what you can do to help them.

    • Documentation. Make sure all your programs and modules are well-documented. Clear usage help (-h), with examples, for all commands in your suite is essential. I further suggest a comment block at the top of every large component explaining the background, intent, rationale, external references, etc.
    • Logging/tracing. If you have not done so already, you should consider adding a logging facility to your programs. When trouble-shooting a production problem, or just to help understand how the program works, your workmates could then run your script (with a verbose flag, say) and it will spit out what it is doing in detail at each step, helping both in trouble-shooting and understanding how it works.
    • Testability. When the new guys make a change to your code, how are they going to test it? You need to plan for this. If you already have a test suite, you could ask them, as a training exercise, to write some new tests.

Re: A reasonable approach to getting a Perl skill foundation?
by graff (Chancellor) on Apr 05, 2012 at 02:44 UTC
    If there's time, I think it would be worthwhile to pick one or two of the more quick-witted co-workers, have them sit at their keyboard with a browser tuned to the man pages and, and stand or sit next to them as they bring up (a copy of) one of your scripts in a suitable editor, and also start it up at a command line using "perl -d ..."

    Once they see how the debugger works and how to look up the docs for functions and modules, it'll just be a matter of remembering those very basic modes of access.

    Make sure to show them the help page in the debugger; how to set and clear break points and watch expressions; how to inspect contents of variables and results of expressions; how to add use Data::Dumper if it not there already just so you can do p Dumper($ref); when to use "s" vs. "n"; and maybe even how to set up a statement to be executed before or after each prompt.

    When it's a matter of getting a quick and sure handle on practical skills for perl programming, nothing beats stepping through some code with the man pages readily at hand.

Re: A reasonable approach to getting a Perl skill foundation?
by sundialsvc4 (Abbot) on Apr 04, 2012 at 21:48 UTC

    If I were one of your successors, I would first ask you to point me to the source-code and to some web pages that will help me understand what’s going on.   (Books would be helpful, except that I know I won’t have time to read them.   I should presume that I do not actually require a thorough understanding of the subject yet.)   I would first stare at the code and take long walks around the parking lot.   I might throw a few darts at nearby tree-stumps.   (See below.)   Then, after a couple days, I’d ask you to sit down with us and just walk us through the programs ... to talk about them ... maybe to let us record the conversation ... maybe join us in a couple games of darts.   (See below.)

    The Perl language is not particularly complicated.   Oh, it has its inevitable quirks as all human creations do, but (especially if you have been in this neighborhood before) it’s not really so crashingly new or esoteric as Perl Monks might suppose.   You can make good guesses and most of the time be close-enuf to right, that is, if the original designer was not too fond of “golf.”   (And if you were, then your photograph will in due time become a dart board.)   (See above... ;-) )   But for the time being at least, what I really would most want to know is ... the designer’s intent.   That means you.   Assuming that I can pore through the actual source code at my leisure, and play with darts and with little bits of rope and model trees and effigies that (come to think of it) do look vaguely like you, and assuming also that I will have your new office extension and maybe the license-plate number of your car:   “show me what you were thinking when you designed and wrote this code.”   That is the one thing that a book cannot tell me.

Re: A reasonable approach to getting a Perl skill foundation?
by soprano (Sexton) on Apr 05, 2012 at 15:48 UTC


    Firstly, congratulations! Secondly however, PerlMonks may surely take some sort of offence that you are leaving behind your Perl programs for "more interesting work"...

    The real issue though is not the choice of programming language, but your company's rather "amateur" approach to designing and developing inhouse code. By implication of your predicament, you appear to be the only one capable of supporting these Perl programs but the issue is only raised when you leave. You don't specify if these were business critical scripts, but what happened previously when you where on holiday and a problem arose, what contingency was in place if you were hit by the proverbial bus? Recommendations to your boss for co-workers to learn Perl are somewhat short-sighted in that (a) your co-workers are likely to be somewhat put out by having to take on that level of commitment to learn and then support (ie. be responsible if it goes wrong) and (b) you may learn Perl but to support someone else's code requires a large amount of sundialvc4's "designer's intent". Maybe a more valuable recommendation to your boss would be that he adopt a better policy on development that allows some resilience against disease, pestilence, sloath, head-hunters and large metal objects travelling a bit too fast. Offering short-term support (or education) to maintain the scripts is honourable but probably not something that will enamour yourself to your new boss (your time is his money) especially as at the end of the day, this is not really your problem anymore.

    To answer your original question though, if people are to learn, it doesn't really matter where they learn from as long as they're interested in doing so. As a support team for a mid-sized US company, we chose to standardise of Perl and we've taught ourselves from books and examples of other people's hard graft. As a team we now all support each other and share our best Perl bits for re-use. I've found the SAMS "Teach Yourself Perl in 24hrs" (Clinton Pierce ISBN 0-672-32276-5) a constant companion in refreshing the basics, with a copy of the "Perl Cookbook" (ISBN 0-596-00313-7) sitting next to it have been all I've needed. With Mr Google and the PerlMonks at the end of a mouse click, you've probably got all you need go.

    Whatever, good luck with the new job!


Re: A reasonable approach to getting a Perl skill foundation?
by mrguy123 (Hermit) on Apr 05, 2012 at 05:35 UTC
    I'm not sure how relevant this might be for you, but in Israel we have a small but very good company that does in house Perl training. They have done a few Perl training courses for my company during the past few years, and if you have something similar in your place of residence, it might really help you (or your boss) out.
    Good Luck with your new position!
    Mr Guy

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://963465]
Approved by marto
Front-paged by Corion
[Corion]: So, the application I'm writing this for is more a nice use case of these command line tools and less an application in its own right, except that I get use out of it :)

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (8)
As of 2018-02-23 19:46 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (310 votes). Check out past polls.