I see a lot of funny stuff said but few clear answers to the original
poster.
* * *
LovesHisLittleShad said:
Is it my imagination, or is Perl a million
times harder than other languages?
No; it's much much easier to use, to get a job done, than almost any
other language. Even if you know very little about Perl, you can try to
write a simple program using it -- and have a fair chance of it working.
However, Perl is also extremely powerful and it's difficult to learn to
control that much power. That's only another way of saying that nothing
is free.
Imagine, if you will, a demon or slave who is extremely intelligent and
will do absolutely anything you ask of it. It understands your natural
language but will not do much to infer your *intent* -- what you request
is what you get, not necessarily what you desire.
* The Monkey's Paw:
The charmed paw of a monkey grants three wishes. Its new owner, without
thinking, asks for cash -- and gets it from the insurance when his son
is killed. Anguished, he wishes his son alive again -- and sees the
decaying corpse walking and talking. He uses his third wish to return
his son to the grave.
The owner of the monkey's paw was careless; he tried to use a tool of
great power without thinking clearly. More wisely, he might have used
his first wish to demand an unlimited number of additional wishes (or
extra monkey paws). He might have specified not only cash but the means
by which he wished to receive it. Asking for long life, he might ask
also for health and for the ability to end that life in case of boredom.
The paw is not to blame.
Perl provides more power at less brainpower cost than any other language
I've seen; and I've seen quite a few. Nothing can compensate for a
failure to think.
...Perl is the only one that seems greek
in most chapters, with very little explanation
of what the people are doing.
Depends on the book but, yes, I agree that there is a sort of rough
assumption in most Perl documentation that the reader has considerable
programming background. Much is taken for granted. That's a shame; I
think Perl is a good place to *begin* for the novice programmer.
I've noticed many places where a Perl feature is explained by saying
"this works the same as the corresponding shell command". That's fine if
you are familiar with *NIX shell; otherwise, you're lost.
O'Reilly's /Learning Perl/ by Schwartz and Phoenix starts off more
gently than some books but even here, I feel, you get stuffed into
things somewhere in the middle and have to find your own ground. To some
extent, I think this is just Perl culture. The assumption is that you're
better off making your own mistakes and forming your own model of how
Perl works, rather than having a model thrust upon you.
It seems as if Perl is often a reaction against the strict structures of
C and other formal languages. For about 50 years, every basic book about
programming covered the same ground in about the same way. Perl books
often seem to delight in violating these conventions. It's more fun but
it's not always more clear.
...does the Perl language literally attract
the wizards of the world to it...?
I'd have to disagree. There have always been proficient programmers who
spend their free time writing weird code. It's exactly equivalent to
puns and word games made up by fluent speakers of English. Perl does
lend itself to this kind of foolishness, though, just as Chinese
(/putonghua/) is the best natural language for making puns.
* * *
If I may venture a suggestion, dive right in. Take a small problem and
code it up. Ignore, for the most part, the advanced idioms and clever
labor-saving approaches; just write code in the most straightforward way
you know. You can write Perl that looks almost exactly like C or Pascal.
When you start to look at code examples, you'll see that Perl syntax is
extremely flexible and not all of the variations are well documented.
You might like to take some snippets and rewrite them in familiar
idioms; then take some of your own code and rewrite them using syntax
you've just learned.
Another tip is to use much more whitespace than you see in the books.
You'll often see code that throws a lot of punctuation marks together,
usually with many braces. Sort this stuff out, balance the braces in
your own mind, and meaning may emerge.
I'm only just learning Perl myself and I've already done a lot with it.
I often find that when I'm frustrated, it's not because Perl is making
me do something weird -- it's that I *think* I have to do something
weird or strained because that's what I've learned in other languages.
But Perl lets me do things the easy way -- if only I try.
Good luck!