If you’ve read any of my first five Perl tutorials, you’ll know that Randal Schwartz graced the comments. For anyone familiar with Perl, you know that Randal is considered a god amongst Perl programmers, having worked with the language from its inception, and having written tons of books and articles about Perl, either in whole or in part, and doing tons of training. In fact, I learned Perl reading his books (and others).
Randal raised several good points in his comments to my Perl tutorials. However, I had an agenda regarding my approach so far. First things first. I haven’t taught Perl as much as Randal has, and only worked with about half the years (10 for me). But the people I have taught either were not programmers, or came from some other programming background. They were mostly corporate clients and felt rather overwhelmed by the cryptic nature of some Perl notation. (Cryptic to anyone who hasn’t programmed in it. I love its compact nature due to regular expressions.) So I had to take a different approach.
It’s the same approach I was taking here on this site: introduce Perl concepts slowly. First introduce functional scripts, then show how to do it more efficiently. At least until I built up enough traffic that your comments would finally tell me what you wanted to know. Then I could start introducing advanced Perl programming to solve real problems that blogmasters and webmasters would encounter. Then you’d see the way I really code in Perl.
Still, my Perl code will never be as efficient or compact as someone with the experience Randal has. And even more to the point, it’s tough finding Perl jobs up here in Canada. So I don’t work with it much anymore except for my own web analytics work. I’m a bit rusty, but wanted to capture what I knew before I forgot it all. (I suffer from a memory-loss condition and no longer have a “real job”, partly because of this.)
Maybe I got wrong. Maybe I should introduce advanced concepts right up front, and hope that you know enough Perl to follow along. Except that I’m not really aiming this site at my peers. Real Perl programmers, in my experience, learn the concepts very quickly and are unlikely to need any of these tutorials. So my intent was to write for anyone else that may want to use Perl and wanted a starting point. It was always my intent to recommend various Perl books, including Randal’s
Anyone care to comment about my approach?
2 Responses
Randal L. Schwartz
March 11th, 2006 at 12:03 pm
1I don’t think my objection is “advanced” vs “basic”, but please don’t make Perl seem harder than it is. If I limited myself to a subset of Perl that does not include the <> handle, I still would have written those examples differently, to not have variables that have no purpose, and not count things multiple ways when one counter would do.
I don’t know why you wrote the code the way you do. It’s not just about “being simpler”. Look at the first few dozen pages of Learning Perl. I introduce no more than once concept per example. And yet, it still looks *very* Perlish even early on. And go back and look at your examples: you sometimes have two or three variables all counting from 1 to N, or 0 to N-1 or something. That’s very confusing. If you’re going to use foreach, use its power. Don’t have an aux variable counting along the same values. If you want to count instead, then use a while() loop or something.
rdash
March 13th, 2006 at 12:56 am
2Randal, it was essentially sloppy editing on my part. I’ll clean up the tutorials at some point soon, and keep your suggestions to heart for the future. Thx
RSS feed for comments on this post · TrackBack URI
Leave a reply
Categories
Archives
Links
Meta
Calendar