Becoming a Master
This book isnt going to make you a Perl master; you have to do that for yourself by programming a lot of Perl, trying a lot of new things, and making a lot of mistakes. Im going to help you get on the right path, but the road to mastery is one of self-reliance and independence. As a Perl master, youll be able to answer your own questions as well as those of others.
In the golden age of guilds, craftsmen followed a certain path, both literally and figuratively, as they mastered their craft. They started as apprentices and would do the boring bits of work until they had enough skill to become the more trusted journeyman. The journeyman had greater responsibility but still worked under a recognized master. When they had learned enough of the craft, the journeymen would produce a master work to prove their skill. If other masters deemed it adequately masterful, the journeyman became a recognized master himself.
The journeymen and masters also traveled (although people dispute if thats where the journey part of the name came from) to other masters, where they would learn new techniques and skills. Each master knew things the others didnt, perhaps deliberately guarding secret methods or doing it in a different way. Part of the journeymens education was learning from more than one master.
Interactions with other masters and journeymen continued the masters education. He learned from those masters with more experience, and learned from himself as he taught journeymen, who also taught him as they brought skills they learned from other masters. A master never stops learning.
The path an apprentice followed affected what he learned. An apprentice who studied with more masters was exposed to many more perspectives and ways of teaching, all of which he could roll into his own way of doing things. Odd things from one master could be exposed, updated, or refined by another, giving the apprentice a balanced view on things. Additionally, although the apprentice might be studying to be a carpenter or a mason, different masters applied those skills to different goals, giving the apprentice a chance to learn different applications and ways of doing things.
Unfortunately, programmers dont operate under the guild system. Most Perl programmers learn Perl on their own (Im sad to say, as a Perl instructor), program on their own, and never get the advantage of a mentor. Thats how I started. I bought the first edition of Learning Perl and worked through it on my own. I was the only person I knew who had even heard of Perl, although Id seen it around a couple of times. Most people used what others had left behind. Soon after that, I discovered comp.lang.perl.misc and started answering any question that I could. It was like self-assigned homework. My skills improved and I got almost instantaneous feedback, good and bad, and I learned even more Perl. I ended up with a job that allowed me to program Perl all day, but I was the only person in the company doing that. I kept up my homework on comp.lang.perl.misc .
I eventually caught the eye of Randal Schwartz, who took me under his wing and started my Perl apprenticeship. He invited me to become a Perl instructor with Stonehenge Consulting Services, and then my real Perl education began. Teaching, meaning figuring out what you know and how to explain it to others, is the best way to learn a subject. After a while of doing that, I started writing about Perl, which is close to teaching, although with correct grammar (mostly) and an editor to correct mistakes.
That presents a problem for Mastering Perl, which I designed to be the third book of a trilogy starting with Learning Perl and Intermediate Perl, both of which Ive had a hand in. Each of those are about 300 pages, and thats what Im limited to here. How do I encapsulate the years of my experience in such a slim book?
In short, I cant. Ill teach you what I think you should know, but youll also have to learn from other sources. As with the old masters, you cant just listen to one person. You need to find other masters too, and thats also the great thing about Perl: you can do things in so many different ways. Some of these masters have written very good books, from this publisher and others, so Im not going to duplicate those topics here, as I discuss in a moment.
What It Means to Be a Master
This book takes a different tone from Learning Perl and Intermediate Perl, which we designed as tutorial books. Those mostly cover the details of the Perl language and only delve a little into the practice of programming. Mastering Perl, however, puts more responsibility on you, the reader.
Now that youve made it this far in Perl, youre working on your ability to answer your own questions and figure out things on your own, even if thats a bit more work than simply asking someone. The very act of doing it yourself builds your experience and prevents you from annoying your coworkers with extra work.
Although I dont cover other languages in this book, like Advanced Perl Programming, First Edition did and Mastering Regular Expressions does, you should learn some other languages. This informs your Perl knowledge and gives you new perspectives, some that make you appreciate Perl more and others that help you understand its limitations.
And, as a master, you will run into Perls limitations. I like to say that if you dont have a list of five things you hate about Perl and the facts to back them up, you probably havent done enough Perl; see My Frozen Perl 2011 Keynote. Its not really Perls fault. Youll get that with any language. The mastery comes from knowing these things and still choosing Perl because its strengths outweigh the weaknesses for your application. Youre a master because you know both sides of the problem and can make an informed choice that you can explain to others.
All of that means that becoming a master involves work, reading, and talking to other people. The more you do, the more you learn. Theres no shortcut to mastery. You may be able to learn the syntax quickly, as in any other language, but that will be the tiniest portion of your experience. Now that you know most of Perl, youll probably spend your time reading some of the meta-programming books that discuss the practice of programming rather than just slinging syntax. Those books will probably use a language thats not Perl, but Ive already said you need to learn some other languages, if only to be able to read these books. As a master, youre always learning.
Becoming a master involves understanding more than you need to, doing quite a bit of work on your own, and learning as much as you can from the experience of others. Its not just about the code you write, because you have to deal with the code from many other authors too.
It may sound difficult, but thats how you become a master. Its worth it, so dont give up. Good luck!