in reply to Code Critique
In other words, you prefer to do things the hard way? If someone said to you, I'm learning algebra, but I've never even read a book on it, would you consider that person:
I'll pick 2 and 4. Reading a book may seem like a time consuming and costly endeavour, but I GUARANTEE it will end up saving you time, and unless that time is worth $0/hour to you, the expense will probably seem trivial in a couple of months when you realize you have now spend scores or hundreds of learning from and consulting a $40 book.
If you live in a major city, go into the public library and search the catalogue for "Perl" -- you'll be surprised. Another guarantee: every single beginner perl title on Amazon will have "used" copies available for <$20 US. I've order lots of used books from their resellers and they are always in great shape.
The only thing I see demonstrated in your posted code is a basic understanding of datatypes, conditional structures, and simple regular expressions: how about loops and functions? As Marshall partially demonstrated, a more complete understanding of programming concepts will make your life easier -- something probably most easily gained by working thru some exercises, like those you'd find in a book. On-line tutorials are seldom as thorough and not infrequently just plain wrong. Also, I don't think the base perl documentation itself (the manpages, POD, etc, also online at perldoc.org) is very good except as a reference, which is what it is intended as. (All apologies to the authors of that documentation, of course, but I would not expect anyone to enjoy learning both programming and perl from it.)
Perl is my first language, and I learned it via the "Perl Cookbook" (used at Amazon $15); it is a decent intro to important concepts with concrete examples, altho 1) there are no exercises, and exercises are great, 2) it suffers from the sketchy style and other problems common in "Cookbook" titles (which I've stopped bothering with). I notice "Learning Perl" is available used for as little as $1 (4th edition, which should be fine), that looks like it might be decent too, also apparently includes exercises. Which I just have to repeat: exercises are great for learning. Beg for your mom's credit card number and go order it now. You'll get it in about a week and it will cost you the same as renting a movie...
My #1 tip:
I was terrible with indentation and formatting originally and considered it trivial and subjective. I was very wrong ;)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Code Critique
by rhiridflaidd (Novice) on Oct 08, 2010 at 09:31 UTC | |
by fullermd (Vicar) on Oct 09, 2010 at 06:54 UTC |