Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: seeking direction to start with perl

by BrowserUk (Patriarch)
on Feb 04, 2010 at 08:31 UTC ( [id://821339]=note: print w/replies, xml ) Need Help??


in reply to seeking direction to start with perl

Learning a new langauge by using it for new (always urgent) projects doesn't often work.

You find yourself sitting there frustrated to hell trying to work out how to do something trivial, that you know you could do in your old langauge almost without thinking, and you usually revert because of the time pressure.

And if you try coding all those nice-to-have-but-you've-never-found-the-time-for projects that have been kicking around, you'll never finish them because there's no pressure to do so.

Make a list of the old language programs that get most use or require most maintenance and sort them by loc ascending in a scratch/private directory. Then try setting aside 30 minutes a day or whatever suits your schedule and go through them one-by-one in order and do your best job of converting them to Perl. Don't sweat the detail of testing and robustness on your first pass. None is ever going to use them for real. The idea is to force yourself to just work out a way to tackle those familar tasks in the new language. As you go through them, you'll find better ways of doing things you've already done earlier. Maybe go back and update those earlier attempts..

One day soon you'll need to write something, and the Perl solution will pop into your head before the old language solution does. At that point, if the new script is anything other than a throw-away, you'll probably still need to write it in the old language because of testing/robustness. But then is the time to set up a more formal attempt to do the same thing in Perl in parallel, and perhaps post your attempts here for critical review.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
  • Comment on Re: seeking direction to start with perl

Replies are listed 'Best First'.
Re^2: seeking direction to start with perl
by Utilitarian (Vicar) on Feb 04, 2010 at 09:20 UTC
    I found the Perl Cookbook a great way to learn as it suits my, admittedly lazy, approach;)
    The examples there and indeed the Seekers of Perl Wisdom here are great for exposing you to correct Perl idioms.
    Like yourself I came to Perl from a Unix admin perspective with a knowledge of scripting and a little C. The difficulty you will encounter is that such knowledge predisposes one to write inefficient Perl ignoring the idioms of the language and so looking over better code will improve your own.

    print "Good ",qw(night morning afternoon evening)[(localtime)[2]/6]," fellow monks."

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://821339]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2024-04-24 22:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found