views:

227

answers:

8

A buddy of mine wants to learn Perl. He asked me how to go about it. I told him:

To learn Perl, you must first write Perl code.

This was seconded by another buddy of mine who writes a lot of good Perl code. It's very zen, but not helpful. The problem is that this is exactly how I learnt to write Perl. At my very first job I had to implement something in Perl and I pretty much just jumped into it and waded and stumbled around until I figured it out.

I was thinking that the best way for him to learn Perl would be to do a small project in Perl. The problem is, I can't think of anything that would be a good starter-project in Perl. For just basic learning and understanding concepts, I have recommended going to PerlMonks, to read Learning Perl, and also to look at Perl Best Practices.

Aside from this, I think a good starter-project would be useful for him to get a grasp of the language. Any suggestions?

A: 

Today something very fashionable is to write a blogging platform.

There was a topic here on SO about why writing a blogging platform, http://stackoverflow.com/questions/471940/why-does-every-man-and-his-dog-want-to-code-a-blogging-engine

klez
+2  A: 

Perhaps some small-scale command-line scripts might be an easy way to start. Duplicate existing shell scripts, or add some minor time saver.

The scripts could be something useful, or something fun (implement Jive/Swedish Chef perhaps?)

Greg Harman
+3  A: 

Find a small perl module. Remove everything but the method definitions. Implement those definitions.

Autocracy
...And pass all their tests, right?
Axeman
+11  A: 

I learned Perl by automating small tasks at work. IMO, that is a good way to get started, since you will have an end goal and a purpose.

publicRavi
+4  A: 

Being from a math background, my favorite way to become familiar with a new language is to grab a project from http://projecteuler.net

The problems on there range from simple one-liners to larger oop projects. Its a nice way to become familiar with the syntax and quirks of a language in a fun brain-teasing way.

stocherilac
Wish I could accept this answer too - thanks for the link!
Vivin Paliath
+2  A: 

Fix bugs in a project written in the language of choice.

I've written toy programs in various languages, but it wasn't until I started fixing bugs in already written code that I really learned them.

Sure, you have to do the different variants on "hello world" for the basics but real programming is about debugging and fixing bugs.

Adding features is an important task, but it also quickly reverts to finding and fixing bugs.

The trick is finding code worth fixing. An open source project somewhere perhaps. It also assumes that one is already proficient in programming some other language.

Does that sound terse? Not my intent. I like fixing bugs.

mmccoo
+1  A: 

My first Perl project was to write a short CGI script to automatically generate HTML photo album pages for directories containing JPEG files.

You can find my first attempt.

So, I chose as my first project something that I wanted to do, something that would have tangible results and something that wasn't that hard.

The resulting script was not very good, but it allowed me to get warmed up.

So, your friend needs ideas that fit those criteria.

Sinan Ünür
+1  A: 

reading Learing Perl is must; after that he can join any open source Perl dev like Padre, SDL. Join #irc and try to listen for some time .. then check out the code and try to fix some bugs

ppant