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

Back to Perl

by ChilliHead (Monk)
on Jan 19, 2005 at 21:07 UTC ( #423502=perlmeditation: print w/replies, xml ) Need Help??

I've recently been 'downsized' from a job where I've been developing in C++ (great time to lose a job, Christmas), and I've decided to spend my time 'between' jobs becoming re-acquainted with perl. The problem is I haven't done any perl development for about 3 years now, and I wasn't particularly a rocket scientist back then. It is amazing how much of this stuff you lose if you don't use it everyday.

I've dragged my camel book down from the shelf and started working through it again, but what I really need is to somehow dredge all the knowledge I used to have back out of the depths of my memory.

Has anyone else been in this situation when they needed to relearn a language? If so, how did you go about?

What ees dis, some kind of hufty?

Replies are listed 'Best First'.
Re: Back to Perl
by demerphq (Chancellor) on Jan 19, 2005 at 21:39 UTC

    I tend to take a non trivial algorithm I know well and do my best to implement it in the new language. Various examples are: Huffman Encoding, 2-3 Trees, Binary Tree. The good thing about this approach is you dont have to learn a new language at the same time as you learn a new concept, instead you already have a conceptual framework you are comfortable with, and all you need to do is map the programming requirments from the one language to the other.

    A good Perl training excercise is to implement a tree structure of some sort as a tied hash. Dont forget to handle the iterators properly. :-)

    Good luck.


      Good advice. demerphq++

      That is exactly what I did moving from language to language. Everyone has a favorite algorithm, right? :)

      --- The harder I work, the luckier I get.

        Everyone has a favorite algorithm, right? :)

        So which was yours? :-)


        I tend to take a non trivial algorithm I know well and do my best to implement it in the new language.

      Bingo. When I found myself with some time to spare and a burning need to figure out how OO Perl worked, I created Roff as an OO exercise in about a day. I learned a lot about how to implment a simple OO Perl program, and although I left myself room to expand it into a more complicated group of classes, never did get around to it.

      This follows on from writing a version of roff in C sometime in February 1993 after I broke my leg and was without a computer for six weeks. In a frenzy of 14-hour days, I wrote a really pretty cool version that even did micro-justification on the dot matrix printer I'd rented.

      The nice thing about roff is that you can just keep on adding features to it -- there's no limit to when it's done.

      Which can be a good thing or a bad thing. :)

      Alex / talexb / Toronto

      "Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

Re: Back to Perl
by Zaxo (Archbishop) on Jan 19, 2005 at 23:14 UTC

    Since you knew perl before, getting back in stride may just need a refresher. Try reading the basic pod first; perlsyn, perlop, and the first part of perlfunc. Then read some module source with perldoc -m. That should get you restarted pretty quickly.

    After Compline,

      Good choice of docs! This will significantly cut down the amount of reading I'll need to do.

      What ees dis, some kind of hufty?
      Any recommendations on which Perl modules might have been written well enough to deserve study via perldoc -m ?
Re: Back to Perl
by quinkan (Monk) on Jan 19, 2005 at 22:30 UTC
    Good luck. I've had the odd (well "odd" isn't the word, "miserable" is) Christmas or two like that. And had Perl as something to keep my mind off the bank statement etc..
    Yes, algorithm stuff was useful, and I suppose it depends a bit on what sort of work you're used to doing. I found lots of document conversion stuff was handy for catching up with regexes, including new developments in regexes. But the other important point was to convert straight functional coding into various O-O styles --to re-acquaint with the object formats etc...
    And exploring the depths of Parse-RecDescent was handy, too.
    There's some bias there -- these are areas I work in or am interested in... but there's no harm in picking your own interest area...
Re: Back to Perl
by Miss Brain (Acolyte) on Jan 20, 2005 at 14:46 UTC

    Whether you're learning for the first time or the fifth, I agree that working through specific problems or algorithms is the only way to understand a language.

    Have been wondering for a while if there is space in the monastery for people to post their favorite little puzzles or programming exercises, perhaps organized by chapters of the Camel Book...

    In school for mathematics, we always had to learn a concept and then make up exam questions that tested that concept. Then our teacher would choose the best ones and give them to us as an (ungraded) exam. You'd get extra credit if your question was included (and obviously no points for getting it right!) I suppose I'm motivated by the same idea here...

    What I'm suggesting is only very slightly different from what we already do here by creating challenges and answering, but organizing it that way would make it more user-friendly for learners at any stage....

    Miss Brain

Re: Back to Perl
by Meowse (Beadle) on Jan 20, 2005 at 10:47 UTC
    I've never actually set out to learn a language without some sort of task I needed to accomplish in it. My ideal working environment, in fact, is one where I am given a great body of ugly and half-functional code in an unfamiliar language, and told to make it right. Then the process of learning the language is subsumed under the task of understanding their evil, broken code, and by the time I've finished the refactoring, I already know the language syntax and constructs intuitively.

    The only time this has ever failed me, oddly enough, was with Perl itself. Perl's syntax is opaque enough (is that the Holy War Alarm[tm] I hear in the background?) that I actually had to learn something of the language even to be able to read an existing application, much less modify it or write my own.

    Good luck!


      Hardly a Holy War coming on. By Larry's own words, Perl is optimized for use, not learning. :-)

      Makeshifts last the longest.

Re: Back to Perl
by geekgrrl (Pilgrim) on Jan 20, 2005 at 21:52 UTC

    When I was looking for a new job and needed to refresh my Perl, I wrote programs that I found useful to use for myself - an online budgeting program , for example.

    When I first was learning Perl, I found it hard to think of things to program. You need to make up fun little assignments I think.

    If you find algorithms interesting, code an algorithm. If you like games, code yourself a Tc/Tkl Tetris. If you like skiing send yourself a snow report every morning...

    I find I get pretty bored and unmotivated unless I am actually making something useful to me in some way...

Re: Back to Perl
by toma (Vicar) on Jan 20, 2005 at 03:49 UTC
    You can only remember what you once knew.

    Memory works best when you are in the same environment and psychological state as when you originally learned. (This, however, is no excuse to get drunk before an exam!)

    Learning works best when you relate new things to what you already know.

    It should work perfectly the first time! - toma
Re: Back to Perl
by greenFox (Vicar) on Jan 20, 2005 at 04:59 UTC

    Lately I find it hard to be disciplined enough to learn something just for the sake of it so what I would do is find an interesting problem to solve and solve it in Perl. Repeat as necessary :-)

    Do not seek to follow in the footsteps of the wise. Seek what they sought. -Basho

Re: Back to Perl
by geektron (Curate) on Jan 20, 2005 at 20:22 UTC
    i've been debating something similar ( back to Java after taking the Sun certification courses but not getting a chance to use it on the job ), and it's a hump ... but i am still working, so that does (obviously) tie up my time.

    i'd almost suggest something like grabbing the Cookbook and make sure that some of the snippets there make sense, and that you could either rewrite them or use them in some other application ...

Re: Back to Perl
by Anonymous Monk on Jan 20, 2005 at 21:55 UTC
    Find something written with perl, that has bugs or missing features, then repair the bugs or add the features. You'll probably fail the first time around, but reading other people's code will refresh your memory.
    We usually don't actually 'lose' things, they just get pushed off the cache and we need to search the file indexes to refresh.
Re: Back to Perl
by samizdat (Vicar) on Jan 26, 2005 at 12:54 UTC
    I have had to switch languages a number of times. As an independent developer, I need to grok the best tool for the job in a real hurry. ( Try learning electron propagation mechanics in 2 nights if you ever get bored. )

    Ovid's Meditation has an excellent quote that speaks to where I'd go. The way to be most agile as a programmer is to seek the highest level of understanding of programming that you can. Syntax learning / refreshing becomes merely a matter of having a full bookshelf handy if you really know what coding paradigms can do for you.

    Instead of diving straight into coding, I'd back off and think about coding. Grok the perl interpreter, try some XS, read a book on computational theory, pencil out a data structure for the Tree of Life. THEN, play with some code that does something neat.

    The previous responses about non-commerical experience and bozos^H^H^H^H^Hbosses are all too true. That's why I like to add to my confidence level by deepening my top-level understanding of programming. Syntax is just 'stuff', and you'll never remember it all. However, if you know what you're looking for, you can always find it.
Re: Back to Perl
by artist (Parson) on Jan 21, 2005 at 15:37 UTC
    The path of learning is always from known to unknown.

    You can write down or recite, as much as you remember about perl language. All the construct,functions that you remember, etc. Relate them to your recent experience and you can recall everything back. I would recommend a tool if you want to use.

Re: Back to Perl
by tcf03 (Deacon) on Jan 21, 2005 at 15:54 UTC
    I have recently changed jobs, in my old job - I used PERL because I wanted to. In my new job I use PERL because I have too. I haven't had to re-learn perl per say, but rather how to code perl for a community rather than just for myself ie easier to read, and more efficient. Its been a trying process, but a worth while endeavor. Iv'e been using PERL for a number of years and have learned to better utilize the tools PERL has to offer, and some features that I never even knew existed.
      I'm about to go thru a similar job-change. I've done a fair amount of perl coding in my current job, but the new one will be primarily writing perl application code. I'm expecting my new co-workers to point out lots of bad habits I've developed.

      ChilliHead - if I were you I'd try to find a way to put your efforts in re-learnig perl during your 'downtime' on your resume. It'll be a good sign to prospective employers that you're actually into programming, not just in it for the $$.

        I've always avoided putting things I've learned at home on my resume.

        Here in the the UK employers aren't interested unless you've got at least 2 years commercial experience in the last 2 years. When they find you've only used x technology at home, their eyes just glaze over.

        Maybe employers where you are understand that the technologies we use in our own time are the ones we know the best.

        What ees dis, some kind of hufty?
Re: Back to Perl
by ocean999 (Initiate) on Jan 25, 2005 at 00:17 UTC
    Relearning a programming language can be a real hell. It's like trying to ride a car, but you don't know where the key has to be put in. Even simple problems that you could then program almost with your hands on your back, become a real struggle. It is not that you have lost your marbles. This is hellish situation that everyone has to overcome when relearning a programming language. You can even overkook when someone says, 'oh but that is simple'. Don't kill him at first sight, but the next time you see him you can tackle the problem.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2022-12-08 20:30 GMT
Find Nodes?
    Voting Booth?

    No recent polls found