Beta
×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Beginning Perl, 2nd Ed.

timothy posted more than 9 years ago | from the string-them-together dept.

Books 141

James Edward Gray II writes "Beginning Perl (Second Edition) is a well named text that starts exactly where it claims. It assumes no prior knowledge of Perl or of programming in general. If that describes your needs, this book is a fine place to start." Read on for the rest of Gray's review.

Beginning Perl is a conversational-style tutorial that will guide you through your first steps into the Perl world and even a little beyond. The first two-thirds of the book cover the basics of programming with Perl including data types, flow control and IO.

The casual flow through here will help prevent fledgling programmers from suffering information overload. The authors handle the need to provide enough information, though, by revisiting topics repeatedly, going a little deeper each time. Unfortunately, this hurts the volume's use as a reference, as it's quite a challenge to go right to something. (Example: The built-in join() is covered in the chapter on "Regular Expressions," which is certainly not the first place I would look.) The index is decent and can guide you through these problems, if you remember to start there.

In keeping with the book's tone, side-trips and diversions are fairly common. Early on, these center around topics like "How to Think Like a Programmer" and "What Exactly is a Binary Number." I mention this because I know some readers appreciate this level of detail, while the interruptions annoy others. I found many of the discussions insightful, but it did occasionally get carried away with itself. (Example: There is a whole page on Perl's versioning scheme that goes so far as to discuss what a "patch pumpkin" is. Interesting or not, it seems out of place in here.)

One of Beginning Perl's real strengths is its constant encouragement of the programmer in training to experiment as a means of further learning. The text often suggests things to try and each chapter ends with a set of exercises. Answers to exercises are provided in an appendix. The only way to really learn programming is to program, so I was glad to see this push in the right direction.

The final third of the book digs a little deeper, examining references, object oriented programming, the CGI protocol and interfacing with an external database. Make no mistake, these are only introductions, but they are a nice addition to a beginner's book that will have you doing a little practical programming quickly. The "Introduction to CGI" and "Perl and DBI" (database interface) chapters really stood out here.

Two chapters were rocky enough to mention. "Regular Expressions" does not handle its content well, I'm afraid. You spend most of the chapter seeing if a pattern matched, but not what it matched. That's an important distinction for me. Learning regular expressions can be tricky and you need to see exactly what's going on. This issue is finally address near the end of the chapter, but it needed to come sooner. True beginners will likely need considerable experimentation of another book to really catch on to regular expressions.

"Object-Oriented Perl" was also problematic. Frankly the chapter bit off more than it could chew and doesn't really manage to teach much because of it. (Example: Inheritance isn't even addressed.) I think a better use of the chapter would have been to outline only the use of objects as a setup for later chapters, leaving the creation of objects to a volume that could spare the space to do the topic justice. Again, beginners will definitely need more material to be comfortable with object oriented programming.

To summarize, if you've wanted to learn Perl but haven't yet taken the plunge, you could do a lot worse than to start with this book. It's a casual tour of the basics with a few teasers for further study opportunities.


You can purchase Beginning Perl, 2nd Ed. from bn.com. Slashdot welcomes readers' book reviews. To see your own review here, carefully read the book review guidelines, then visit the submission page.

Sorry! There are no comments related to the filter you selected.

fp (-1, Offtopic)

Anonymous Coward | more than 9 years ago | (#10911137)

fp

Re:fp (-1, Offtopic)

skids (119237) | more than 9 years ago | (#10911240)

Yes, you got the first post. Kudos to you. On a day when most of the country is travelling over the hills and far away to granma's house... you really got the best of THEM, didn't you?

They'll never know it either, the poor bastards. By the time they get back to reading ./ your post (and probably mine too) will be modded down into the -1 plane of irrelevant nonexistance. They won't be able to see the mastery by which you obviously did not use a L337 B07 to elevate yourself above their sheep-like status. No, lacking the skills to do even that you just typed fast, and short. You didn't even assume to have a pre-typed text to paste in, lacking the physical coordination to do that with any level of confidence that you wouldn't suffer the horrible embarrassment of saying you got the fp, when in fact you didn't. Now that would be a shame.

But you do have your permanant place in history. Forever, the six bytes of message #10911137 will be archived here at slashdot, and you can put the link in your signature and scream to the world, "Look, I got a first post, I'm a screaming idiot!"

Everyone have a good turkey day... we've got plenty to go around.

Re:fp (-1, Offtopic)

Anonymous Coward | more than 9 years ago | (#10911286)

you've gotta be pretty bored to write all that.
me? I'm procrastinating ;)

Author? Publisher? (1, Insightful)

gounthar (212393) | more than 9 years ago | (#10911169)

Looks like somebody screwed his editing job again...
I'd like to know who wrote it. Thanks for the info.

Re:Author? Publisher? (3, Informative)

Eric Giguere (42863) | more than 9 years ago | (#10911215)

According to the ISBN buried in the BN.com link, it's an Apress book by James Lee and Peter Wainwright. See GoPriceIt [ericgiguere.com] for more details. Or just go straight to the Amazon entry [amazon.com] for the book.

Eric

Re:Author? Publisher? (2, Informative)

Anonymous Coward | more than 9 years ago | (#10911411)

Taken from the top of the slashdot review..

author James Loo with Simon Cozens and Peter Wainwright
pages 429
publisher Apress
rating 7
reviewer James Edward Gray II
ISBN 159059391X
summary A Solid First Perl Tutorial.

Re:Author? Publisher? (1)

dutt (738848) | more than 9 years ago | (#10911530)

James Loo with Simon Cozens and Peter Wainwright

Re:Author? Publisher? (1)

Romanmir Cumelon (471593) | more than 9 years ago | (#10912878)

Yeah, because it's too hard to click on the bn.com link that's on the bottom. I have my day planned down to ten second blocks.. And if I have to spend the extra five seconds it takes to do some rudimentary research, I'm gonna blow my whole schedule.

('course, it doesn't excuse the mistake made about not following normal book review form, but hey, we're about solutions here.)

Hold Crap! (0)

liquidpele (663430) | more than 9 years ago | (#10911199)

"It assumes no prior knowledge of Perl or of programming in general."

Maybe it's just me, but I wouldn't recommend Perl if you have no prior programming experience...
html, then php maybe....

Re:Hold Crap! (3, Informative)

strider5 (15284) | more than 9 years ago | (#10911226)

I would actually consider Perl to be one of the best starting languages actually (unless you plan on going on to be a professional coder).

I learned Perl before any other language and found that the Llama book was a perfect introduction to programming techniques and Perl alike.

Re:Hold Crap! (3, Insightful)

skids (119237) | more than 9 years ago | (#10911327)

Perl is a great beginner's language. You don't have to compile it, the required variable prefixes clearly allow newbies to see what's a scalar, array, etc at least until you get into the more complicated dereferencing, and the user can be introduced to the more natural-language forms first, so they don't get parenthesization shock (e.g. $i = 2 unless $this or $that;)

Re:Hold Crap! (2, Interesting)

alw53 (702722) | more than 9 years ago | (#10911940)

Perl's a great beginner's language until you go beyond single-dimensional arrays.

@b=((0.8,0.9,1),2,3,4);

$b[0] => 0.8

because it flattened out the list for some reason.
Gotta love those at-signs and dollar-signs.

You have to say

@b = ([(0.8, 0.9, 1)], 2, 3, 4);

So the inner list needs brackets.
Why didn't the outer list need brackets?

Then you can say $b[0] and get ARRAY(0xb75eb0).

Well, maybe @b[0] will work, no that gives
ARRAY(0xb75eb0) also.

What you have to say is @($b[0]). Of course, how could I have missed that??

(The preceding cribbed from http://www.garshol.priv.no/download/text/perl.html ).

Re:Hold Crap! (1, Informative)

Anonymous Coward | more than 9 years ago | (#10912072)

erm, I think you meant @{ $b[0] }. note difference in parenthesis.

The reason the [ ] are needed in the original declaration is because they create an array reference. (Much like @{} dereferences). The ARRAY(0xb75eb0) is simply the reference itself.

Additionally, you can access the inner arrays via $b->[0][$var] for direct access. No one I've explained perl too has particular difficulty with these topics.

Warning, Learning Required (2, Informative)

chromatic (9471) | more than 9 years ago | (#10912409)

because it flattened out the list for some reason.

As the documentation indicates.

Why didn't the outer list need brackets?

Because of context, as the documentation indicates.

Of course, how could I have missed that??

You didn't read the documentation. If you had, you'd know that the parentheses don't do anything besides expression grouping. You'd know that arrays can only contain scalars. You'd know how to store a list in a scalar by using an anonymous array or array reference.

You can agree or disagree with that decision, but until you understand context in Perl and its implications, Perl will continue to confuse you.

Re:Warning, Learning Required (1)

Fahrenheit 450 (765492) | more than 9 years ago | (#10912506)

You can agree or disagree with that decision, but until you understand context in Perl and its implications, Perl will continue to confuse you.

Um, yeah... but we're talking about Perl as a first language here, and the behavior pointed out above is hardly intuitive, and is likely to be a stumbling block for someone just learning how to program. Someone like that is far more likely to understand the concept of a nested list than that of an anonymous array or an array reference.

Re:Hold Crap! (0)

Anonymous Coward | more than 9 years ago | (#10912028)

Perl is a great beginner's language.

Nonsense.

You don't have to compile it,

which is a bad thing, because it means that even their typos don't show up until it actually tries to run that part of the program. So they think they've succeeded, when really they still have a buggy mess.

the required variable prefixes clearly allow newbies to see what's a scalar, array, etc

Yeah, because of course that's far more relevant than the things Perl makes very hard to tell - like what's a number and what's a string!

Nope, start them with something that requires a bit of B&D. Using a strongly and statically typed compiled programming language will give them some feel for what programs actually do, and it will give them some idea of what they can get wrong.

THEN show them Perl - and they might appreciate the liberation, or they might have more sense, but either way they will be able to make an INFORMED choice about whether they want to sell their safety and execution speed in return for fast development times.

Re:Hold Crap! (2, Interesting)

skids (119237) | more than 9 years ago | (#10912265)

As to compiling, beginner's aren't developers. Perl's ability to chew through bad code makes it *more* educational because you get to see what the bad code did. It also makes it a lot less frustrating when users don't have to pass syntax checks before they even try to run their code. (Developers, on the other hand, can test syntax with commandline switches.)

In Perl, a number is a string and a string is a number. How the value contained in a scalar is interperated is a context matter. So to say Perl makes it hard to tell what is a number and what is a string, is to misunderstand what a perl scalar is.

And as far as security goes, perl doesn't crash its own stack nor will it munge data of nearby variables due to a miscast. I would never trust a newbie coder to write secure code, but then, if I did, it had sure as hell be in a higher level language to avoid buffer overflows.

I like C, too, and I do think using it leads to a better understanding of the actual data manipluations a program performs. But the question is in the merits of teaching programming concepts, and that understanding is only one concept among many. C can't be beat for speed. But when you are learning how to program from scratch, speed is of no concern.

Re:Hold Crap! (0)

Anonymous Coward | more than 9 years ago | (#10913573)

Actually everything in perl is an object of class SCALAR.

SCALAR is a polymorphic object that can behave like a number, a string, a pointer, . . .

The behavior the SCALAR exhibits is context dependent.

Re:Hold Crap! (2, Informative)

Fahrenheit 450 (765492) | more than 9 years ago | (#10912434)

You don't have to compile it,

which is a bad thing, because it means that even their typos don't show up until it actually tries to run that part of the program. So they think they've succeeded, when really they still have a buggy mess.

Well that's not necessrily a compiled vs. interpreted issue. Give 'em an interactive REPL like with Haskell, OCaml, Lisp, Scheme, etc., and that will catch any of the errors that the compiler would catch -- without having to stop and recompile all of the time. Plus, you get type inferencing goodness with the languages like ML and Haskell which make bugs easier to spot, and essentially do away with the need for explicit type annotations.

Re:Hold Crap! (2, Insightful)

Fahrenheit 450 (765492) | more than 9 years ago | (#10912327)

the required variable prefixes clearly allow newbies to see what's a scalar, array, etc

Yeah, but that can be ugly and nonintuitive. For example, in the Perl Cookbook, one of the very first things one reads about arrays is:

So, given this list: @tune = ( "The", "Star-Spangled", "Banner" ); "The" is in the first position, but you'd access it as $tune[0].

Woof... that is ugly to these eyes. And then there's the horrific typing (or lack thereof) issues... Is it really sensible that "Hello" + 2 is a valid value? And is the behavior of something like (3+2) x 4 something that should be clear to a beginner?

Nah... give me something like Haskell as a beginning language. And before anyone starts screaming about monads or I/O, it's possible to introduce them in a gentile, sensible way [yale.edu] .

Re:Hold Crap! (1)

nessus42 (230320) | more than 9 years ago | (#10913542)

Perl is a great beginner's language.
When I took Computer Science 101 at MIT, the first thing the proffessor said on day one, was, "If you already know Basic or Fortran please raise your hand."

After waiting for a bunch of students to raise their hands, he continued with, "You people are going to be at a serious disadvantage in this class."

Perl is not a great beginner's language. It's not even an adequate one. Anyone who learns it will learn bad habits that are in opposition to all the principles of good software engineering.

Python, on the other hand, is a great beginner's language.

|>oug

Re:Hold Crap! (3, Insightful)

ackthpt (218170) | more than 9 years ago | (#10911295)

Maybe it's just me, but I wouldn't recommend Perl if you have no prior programming experience... html, then php maybe....

I'd hardly call HTML a programming language...

I'd recommend C, which any decent *nix install should include, then move to perl.

but then I love C...

Re:Hold Crap! (2, Funny)

John Bokma (834313) | more than 9 years ago | (#10913127)

PHP is a programming language?

Re:Hold Crap! (1)

Vulcann (752521) | more than 9 years ago | (#10911301)

Considering Perl has a "do what I mean" style, has no pointers, has no "real" object-orientedness, has very little structure, and is generally very loose on types, I would argue its perhaps the best tool to begin experimenting with programming.

I've worked with a lot of languages - C/C++, Delphi, Java, Perl ...but I'd have to say Perl is easily the most "fun" to work with - perhaps thats as good a reason as any to have it as you're first language.

Re:Hold Crap! (2, Insightful)

sik0fewl (561285) | more than 9 years ago | (#10911305)

I see nothing wrong with learning Perl first (other than the fact I tell everybody they shouldn't touch Perl with a ten-foot pole). Perl was one of the first languages I got into and it's very easy to get started. Sure, there's twenty different ways to do things and things can get really complicated and complex, but if you're just beginning programming you're not gonna be doing the hard stuff.

Using Perl is a good way (as good as anything else) to get accustomed to programming constructs and variables.

As for learning HTML first.. well that's not even a programming language and wouldn't teach you a thing about programming. PHP would be a good one, but you have to know a little HTML first. (Sorry if that's what you meant by HTML, PHP).

Re:Hold Crap! (1)

liquidpele (663430) | more than 9 years ago | (#10911346)

Well, I've had to teach my gf and a couple others some simple things... and just the idea of a "variable" is hard to grasp for some people. Thats why for the non-technical I would start with html (not real programming but whatever) because they can get used to typing things and the idea of syntax and debugging when it doesn't look right. I suppose this book is geared towards the more technically inclined though...

As for learning Perl first, it's got a steap learning curve is all I meant, but if you can handle it then dive on in.

Re:Hold Crap! (2, Insightful)

Waffle Iron (339739) | more than 9 years ago | (#10911612)

Well, I've had to teach my gf and a couple others some simple things... and just the idea of a "variable" is hard to grasp for some people.

I've been programming computers for over 25 years, and sometimes a variable can still be hard to grasp: Is it the data value? Is it the storage slot? Is it a reference to the storage slot? Is it the name of the variable? Is it the binding between the name and storage? Does the value have different names in different scopes? Does the storage slot have a type? Does the value have a type? Is the value mutable? Do I have to manage the storage allocation myself? What are the exact lifetimes of all of the above? In what scopes are they visible? Does it exist in a strange place like a closure?

Some languages expose most all of these concepts to the programmer (Perl is one of them, even though it doesn't usually make you explicitely deal with most of these), and things can get tricky.

Re:Hold Crap! (1)

Fahrenheit 450 (765492) | more than 9 years ago | (#10911918)

What's so strange about a closure?

Re:Hold Crap! (1)

BlueCodeWarrior (638065) | more than 9 years ago | (#10912861)

Make a paralell to algebra...that's what I always did.

Re:Hold Crap! (2, Interesting)

dTaylorSingletary (448723) | more than 9 years ago | (#10911437)



I think the reason perl was the easiest language for me to grasp from the get-go was because variables were just that ... variable! And very! I didn't have any real brain blocking in learning a programming language until I tried one that was very strongly typed, where you have to set the possible size of said variable ahead of time... know how many slices an array might have ahead of time, etc.

Perl just seems to connect better with me, in that any given variable can be any given thing. A number. A string. An array. A hash. A reference to any of these things. It can even be an object, or subroutine. All things are mutable and transient.

Now if this makes perl a good starting language or not I don't know -- maybe it makes learning other languages harder, because you always with that the other language was more like perl.

At least I do.

Re:Hold Crap! (0)

Anonymous Coward | more than 9 years ago | (#10912293)

I didn't have any real brain blocking in learning a programming language until I tried one that was very strongly typed, where you have to set the possible size of said variable ahead of time... know how many slices an array might have ahead of time, etc.

Funny... I'm having difficulty thinking of a language like that. None of the modern statically typed languages I've ever used - Haskell, ML, and such like - require you to declare the size of variables in advance. You just use them - just like in Perl.

The difference is that you CAN declare them in advance, if you want to - and they complain if you are using them inconsistently. Perl, meanwhile, makes no complaint if you use a string as a number... even though 99% of the time this represents a bug, and the remaining 1% of the time it's not really very arduous to add an explicit type conversion.

Re:Hold Crap! (1)

Fahrenheit 450 (765492) | more than 9 years ago | (#10912661)

Well, its possible he's talking about something like OCaml's hashtables, where you have to supply an initial size when you create it. Or he may even be talking about its strings and arrays, which require you to specify the size at creation time (unless you create one as an array/string literal, in which case the size is implicitly supplied).

Even so, it's hardly an issue...

Re:Hold Crap! (1)

pooh666 (624584) | more than 9 years ago | (#10913315)

I wish I had done things in this order. 1. a shell like ksh 2. c 3. Then Perl.. I missed a great deal I had to go back to with not learning the first two to start with.

Re:Hold Crap! (4, Insightful)

sheriff_p (138609) | more than 9 years ago | (#10911313)

HTML? Isn't that a markup language, and not a programming language? How does HTML teach you any programming concepts?

And then ... PHP. *shudder*. "Like Perl without the toolbox, like C without the speed".

You give no reason why you wouldn't recommend Perl as a starting language, so I can't rebutt them. However, I would, for one reason:

It allows programming to be FUN. Ideally, everyone would learn ASM first, then C, then Lisp, then Python, then Perl, then Ruby. But you'll probably have killed most people's desire to program with the first two, and freaked them out with the third.

+Pete

Re:Hold Crap! (1, Insightful)

Anonymous Coward | more than 9 years ago | (#10911552)

That's the truth. Back in the early 80's we had BASIC and you could dink around and get immediate results. It even used variable names like $firstname, with dollar sign like Perl does. :) If you wanted to be hardcore you could peek & poke, which doesn't really apply anymore these days (kernel won't allow you to access arbitrary memory) but you can still do stuff with Inline::ASM if say you have mmap'd a framebuffer and want to play around with putpixel-type algorithms.
All in all you could do a lot worse than Perl for a beginner language. I mean, some people start out with Java. *shudder* Somebody I know had the misfortune of sitting through some Java class at uni and it totally turned him off programming.
And all you elitist motherfuckers who think non-programmers shoudln't code: go eat a dick.

Re:Hold Crap! (4, Interesting)

Daniel Dvorkin (106857) | more than 9 years ago | (#10911618)

HTML? Isn't that a markup language, and not a programming language? How does HTML teach you any programming concepts?

Actually, HTML is a very good thing for people who have never done any programming in their lives to learn, because it does teach what I consider not only a "programming language concept," but the very idea of programming: giving the computer a series of instructions which produce an output noticeably different from the input. This is fundamentally different from the way most people use computers, in which output immediately follows input, and one is obviously a product of the other.

No, HTML isn't Turing-complete, and no, learning it won't teach you any of the theoretical basis of programming. But it will teach you how to write something that can meaningfully be called "code," and let you see the results of your work ... which was a revelation for me, and for many others. In my case, at least, cobbling together my first pointless, amateurish "this is my homepage hope you like it" Web page led, slowly but quite directly, to a programming career. And I don't think I'm unique in this.

Re:Hold Crap! (0)

Anonymous Coward | more than 9 years ago | (#10912340)

+1

Re:Hold Crap! (-1, Troll)

Anonymous Coward | more than 9 years ago | (#10911806)

Perl killed my desire to code in it the first time I saw it and realized it was the result of one persons
total inability and unwillingness to learn and improve a unix shell, shell scripting and tools like
(g)awk and sed.

Re:Hold Crap! (1)

Dr. Evil (3501) | more than 9 years ago | (#10911945)

PHP lets you do useful stuff without the slop. It also has documentation which is better suited for a person who doesn't know the language.

Perl has a lot of history behind it... which if you don't know the history, you're SOL. I mean stuff like if you're trying to use a library, you'll have to know an awful lot about what the author did. Toss an object to a person who's never heard of objects, or show some cryptic bit twiddling or make them troubleshoot some random Perl guy's overzealous use of regular expressions. Ouch. Yeah it applies in all languages, but in Perl, there's more of them.

The only good thing about Perl for learning might be that it is forgiving, you can be creative in how you manipulate data.

And hey, while HTML isn't a language, and should never be considered such, would you really want to teach Perl to somebody who couldn't grasp HTML?

Progressing to PHP from HTML might not be such a bad idea. People can figure out the difference between the browser and the server, then learn about simple things like variables, functions, loops, arrays, etc, while dealing with some hard guidelines they need to conform to in their output.

With that little skill, they can do some cool stuff with a web site. They can do stuff they find useful, show off, or solve problems. With Perl alone, they're locked in an ugly box on their Windows machine, trying to figure out CGI, or waiting for their skills to develop to the point that they can interface with various toolkits.

Teaching them Perl alone is giving them access to a suite of tools which they'll probably never figure out why they need it... but...

... once they know the basics of functions, loops, interation and so forth... then a language like Perl might be o.k., if they're a sysadmin, crunching text and/or have a need for CPAN...

...but then... you might wind up with the problem I see all the time... people writing shell scripts in Perl. Ugh. Very unnecessary.

Re:Hold Crap! (3, Funny)

Coryoth (254751) | more than 9 years ago | (#10912442)

(if (parses (your brain) (things that way)) (is (lisp fun)))

To be honest mine doesn't (which is probably why the above is quite wrong), but I do know people who seem to find it far more "natural" and "readable".

Jedidiah.

Re:Hold Crap! (1)

renoX (11677) | more than 9 years ago | (#10912839)

Python, Perl and Ruby?

Those three are redundant: pick one, either Python or Ruby (Perl is a mess IMHO)..

As for Lisp, I don't know: it could also be Haskell, OCaml, Scheme, Erlang.. Choosing one is difficult!

Re:Hold Crap! (1)

tootlemonde (579170) | more than 9 years ago | (#10912887)

It allows programming to be FUN.

A succinct case [perl.com] for Perl as a first language is made by Simon Cozens, one of the co-authors of the book:

It's ideal because it's a real-world language, unlike one designed specifically for teaching, such as BASIC (Visual or otherwise). It's a high-level language that deals naturally with natural concepts like strings and lines of text, unlike something like C; and it allows easy data and text manipulation without a tortuous syntax, unlike something like Python or Tcl.

There's an informed discussion [thepen.com] of the question at PerlMonks.

A more interesting question is what is the best second language. Now that programming has your attention, should you move to something that teaches the fundamentals like Assembler or C or do you move to something with a broader scope like C++ and Java? Or do you choose something mind-expanding like Lisp or Smalltalk?

Re:Hold Crap! (1)

five18pm (763804) | more than 9 years ago | (#10911349)

People have cut their teeth in assembly language and C. Perl is much more easy (easy as in getting your job done quickly). Besides, in Perl there are many ways of doing things. If a beginner is not comfortable thinking in one way, he can always choose another. He might end up being a better programmer. Except he might be eternally corrupted by Perl and keep asking for Perlish features in other languages (can I have split and join in Java, please?)

Re:Hold Crap! (1)

rduke15 (721841) | more than 9 years ago | (#10912405)

(can I have split and join in Java, please?)

What? There is no split or join in Java?? I know there isn't in Visual Basic or VBA, but then, what do you expect from VB* anyway...

But Java, and even javascript, I would have thought to be a little more programmer-friendly.

Well, I see there are still many good reasons to stay with Perl...

Re:Hold Crap! (0)

Anonymous Coward | more than 9 years ago | (#10912777)

There's no join() but Java 1.4 introduced a split() method that returns a String[] with the pieces in it.

Re:Hold Crap! (0)

Anonymous Coward | more than 9 years ago | (#10912756)

can I have split and join in Java, please?
No join, but split you can have. Look here [sun.com] .

Re:Hold Crap! (2, Insightful)

TheFlyingGoat (161967) | more than 9 years ago | (#10911374)

HTML? HTML is a markup language (it's in the name), not a programming language. This is like calling the garbage that Word spits out programming code.

Anyway, it's a good idea for anyone to learn HTML (or even better, XHTML), since it's everywhere now. However, learning php as a first programming language is a bad idea. Don't get me wrong, php is THE language I use for work (a little Perl and C++ on the side), but it won't allow a person to learn any other programming languages any easier.

I started with Pascal, then C++, and later Perl, PHP, and many more. Pascal is actually a VERY good starter language, but doesn't have a whole lot of real-world applications. Perl is a good starting place, but people should learn the "right" way to do it instead of the way it's commonly used. use strict and turn on warnings is the best way to do this. Then Perl is a good starting point and will making learning more complicated languages (C++, Java, etc) or simpler languages (PHP, Basic, Python) much easier.

Re:Hold Crap! (1)

liquidpele (663430) | more than 9 years ago | (#10911452)

I never said html was a programming language, but like you said it's a good thing to teach.
As for php, I was assuming we were only talking about web scripting languages, not C/c++/pascal/etc

Although now that I think about it, Python would probably be better... I think that's what they start with in the new intro programming class at my college nowadays too...

Re:Hold Crap! (0)

Anonymous Coward | more than 9 years ago | (#10911609)

I'd say that that HTML isn't any kind of language, just a ASCII file format with delusions of grandeur.

Re:Hold Crap! (1)

pteaxwa (126635) | more than 9 years ago | (#10911553)

Maybe it's just me, but I wouldn't recommend Perl

Agreed. Python is the way to go for a newb.

Re:Holy Crap! (1, Insightful)

Tumbleweed (3706) | more than 9 years ago | (#10911859)

I think one's first programming language should also be a strongly typed language, else you'll never be able to troubleshoot Perl. It's the same reason why JavaScript shouldn't be your first language.

Remember the quote, "Perl is Internet Yiddish." :)

Re:Hold Crap! (1)

sodul (833177) | more than 9 years ago | (#10911936)

I do like Perl a lot: it allows me to do many things in just a few lines of code (or a few thousands)...
But my biggest complain is that perl allows you do use obscure syntax and invisible variables. You end up with poeple writing code completly unreadable that you have to maintain.
I'll avoid talking about using CPAN, now I try to get the modules I need using apt-get.

Re:Hold Crap! (1)

John Bokma (834313) | more than 9 years ago | (#10913188)

What's wrong with CPAN? I have never had any problems with installing modules using ppm.

Re:Hold Crap! (1)

0racle (667029) | more than 9 years ago | (#10912526)

Perl was very easy for me to pick up and make usefull. It seems like a very good starting language.

Re:Hold Crap! (0)

Anonymous Coward | more than 9 years ago | (#10913292)

Why is it that the people who complain about Perl are usually complaining about its flexibility? Yet those same people take liberties with everyday English? Isn't the expression of ideas more important than a rigid structure for presenting those ideas? I'd like to see the Perl-bashers exhibit a little logical consistency and start doing their posts in well-formed XML -- just so we know can be clear about they are saying... ;)

Market Flood (5, Insightful)

strider5 (15284) | more than 9 years ago | (#10911202)

was there really a market for another beginner's book in Perl?

Learning Perl (O'Reilly) did an absolutely exquisite job at introducing people to programming and Perl simultaneously.

Re:Market Flood (1, Insightful)

Saeed al-Sahaf (665390) | more than 9 years ago | (#10911216)

And besides, Perl is dead, right? Hasn't PHP taken the Perl crown jewels?

Re:Market Flood (0)

strider5 (15284) | more than 9 years ago | (#10911255)

what are you calling the crown jewels?

Maybe Perl is diminishing in the land of web developers, but Perl is alive and well in the System Administrator realm.

Coupled with DBI, MySQL, and mod_perl, it still represents an unbelievably good solution for most CGI applications. want it to be more like PHP syntax, use Embperl.

Re:Market Flood (-1, Redundant)

Saeed al-Sahaf (665390) | more than 9 years ago | (#10911296)

...joke...humor...

Re:Market Flood (0)

Anonymous Coward | more than 9 years ago | (#10911455)

Glad to see you're still in the mix [welovethei...nister.com] , Muhammed.
However, your post hints at a dimming of the rhetorical flame, which I find sad.
Viagra?

Re:Market Flood (1)

el-spectre (668104) | more than 9 years ago | (#10911476)

No no, PHP sucks the Family Jewels...

(Sorry, JAPH who tried and dislikes PHP)

Re:Market Flood (2, Insightful)

0racle (667029) | more than 9 years ago | (#10912558)

What crown jewels? You mean regex and the vast number of pre-existing modules? I think PHP has a long way to go on both counts. I don't know PHP, I hate Python but I like Perl. However, its the modules that make it so much more usefull to me, and thats the reason I stick with it.

Re:Market Flood (0)

Anonymous Coward | more than 9 years ago | (#10912886)

No, those Pin Head Punks took Ozzy's jewels.

Re:Market Flood (1)

TopShelf (92521) | more than 9 years ago | (#10911235)

That's what I was thinking when I saw the headline. Is this story a dupe from 2000, or something?

Re:Market Flood (1)

Eric Giguere (42863) | more than 9 years ago | (#10911368)

was there really a market for another beginner's book in Perl?

In a free market -- not to be confused with a GPL market -- this is called competition. Just because there's already a good book out doesn't mean that a better one can't be written. Not to say that this one is better than the other. Also, publishers like to fill in their catalogs with books on all the hot/important/niche topics on the chance that one of them will really fly and to make themselves appear current and relevant to book buyers.

Also, with computer books there's a definite shelf life for most books. All my published books [ericgiguere.com] are way too old, for example, to be considered current anymore, though a lot of the info I put in them is still valid. People looking at Learning Perl might think it's too old as well, since the third edition was published in 2001. It's hard to write books that aren't out-of-date before they're even shipped to the store, but when the copyright date is no longer in the same or previous year, it gets harder to sell them... The rule of thumb I've heard is that for most computer books the first sixth months are the most critical, that's when you'll see the most copies. That's why it's important to get good reviews up on Amazon as early as possible and to promote the book like crazy around its publication time. As with anything, there are exceptions to this, like the venerable C Programming Language.

Eric

Re:Market Flood (1)

el-spectre (668104) | more than 9 years ago | (#10911507)

While it IS true that books can go out of date quickly in this field, the fact that Larry works for O'Reilly and wrote/contributed to a number of very good Perl books for them gives the O'Reilly books an advantage.

Re:Market Flood (1)

Eric Giguere (42863) | more than 9 years ago | (#10911572)

Again, I wasn't trying to say that there actually is a need for a new book, or that the new book is better, I was just trying to explain why someone would publish another book on a given topic. I'm sure Larry's book still does well.

Eric

Re:Market Flood (4, Insightful)

Qzukk (229616) | more than 9 years ago | (#10911379)

More to the point, is there a market for another Beginning Perl 5 book now?

The End Is Nigh [perl.org] .

Re:Market Flood (1)

el-spectre (668104) | more than 9 years ago | (#10911532)

Sure, Perl 5 will remain relevant for a number of years... almost everything out there (millions of programs) is written in 5, and 6 isn't even completely written yet.

Just because newer languages are out, doesn't mean that C++ is a bad language to learn, for example.

Re:Market Flood (1)

Rie Beam (632299) | more than 9 years ago | (#10911408)

Eh, because computer books, especially the beginners' market, appears to be a good source of income - where else can you basically retype the bundled documentation for a programming language or system, and sell it for $50 a pop?

Miss Ol' Randal (3, Informative)

ackthpt (218170) | more than 9 years ago | (#10911239)

My favorite Perl book was the first one, published by O'Reilly, back in the 90's, by Randal. They've all seemed so dry since. :-\

Only a 7? (1, Funny)

Anonymous Coward | more than 9 years ago | (#10911250)

Only a 7/10 score? What did the author ever do to you to deserve such a cutting insult? He must have had to kill your cat, steal your girlfriend, or erase your SNES emulator saved-game directory! Possibly he even put the toilet seat down at your house, causing you to accidentally leave a few pee drops on the seat when you took a midnight piss while tired and bleary-eyed. I can't say. I honestly can't imagine what it would take to send a man over the edge and only give a 7 for such an excellent book.

For those of us who are too cheap.... (5, Informative)

Dr. Mortimer (461903) | more than 9 years ago | (#10911262)

There are also a lot of free resources out there to help you learn Perl without having to buy a book. The following website's tutorials listing helped me get started:

http://www.perlmonks.org/index.pl?node=Tutorials [perlmonks.org]

YMMV of course, and you may very well wind up buying a book anyway, but still check that out!

Re:For those of us who are too cheap.... (1)

LnxAddct (679316) | more than 9 years ago | (#10911473)

OSS is a wonderful thing. For those who don't know perl, I would definitly recommend learning it. For those who are intimidated by Perl or just interested in learning other useful languages (a must for every geek) try reading these free online books

Dive into Python [diveintopython.org] - A very good and informative book on python.
Why's (Poignant) Guide to Ruby [poignantguide.net] - If you want to read a free book on ruby, not only is the very informative, buts its an amusing read as well with quite interesting and funny stories to be told along the way.

Regards,
Steve

Re:For those of us who are too cheap.... (2, Funny)

rduke15 (721841) | more than 9 years ago | (#10911864)

For cheap beginners, they should certainly first know that they can just type
perldoc perlintro
or
perldoc perl
etc.

After that, they can see in
perldoc perldoc
what else they already have at their fingertips.

And of course, even non-cheap non-beginners will continue using the rest of perldoc.

sorry, I hate perl. (3, Funny)

grub (11606) | more than 9 years ago | (#10911276)


It assumes no prior knowledge of Perl or of programming in general.

Does it mention the need for chicken blood, human tallow candles and pentagrams made from ground baby skull? Sorry, I liked Perl Back In The Day but the OO is just bolted on and I can't do anything with it I can't accomplish with Python (or Ruby although I'm still learning that).

Re:sorry, I hate perl. (2)

StevisF (218566) | more than 9 years ago | (#10911596)

I'm sick of this tired old argument. PERL is not object oriented (or has poor object oriented support), so PERL is bad. There are plenty of programs which do not benefit at all from being object oriented. I've written hundreds of programs in PERL, some of them very complex, and none of them have ever been object oriented or would benefit from being object oriented.

Re:sorry, I hate perl. (0)

Anonymous Coward | more than 9 years ago | (#10912603)

No, the argument is that there isn't anything (much?) Perl can do that Python and Ruby can't.

Any examples? (1)

Peaker (72084) | more than 9 years ago | (#10912776)

"Object Oriented" means a lot of different things to a lot of different people.

If you cite examples of your designs or pieces of code of yours, I'm sure I can find some things that could look nicer or be better implemented via Python's OO mechanisms, and I am not just talking about the C++ kind of OO (encapsulation/inheritence/polymorphism) but also about Python's __getattr__ and other powerful features inherent in its OO design).

Re:sorry, I hate perl. (2, Interesting)

pooh666 (624584) | more than 9 years ago | (#10913290)

What really pisses me off is that you were modded BELOW this obvious troll.

And for the record OOP in Perl is NOT bolted on, it is just that Perl is so damn flexable that you can do OOP in man ways. This is a VAST difference.. You can get into the meat of OOP with Perl and not have to depend on what someone's idea of OOP is.

perl6 book coming soon (4, Funny)

OmniVector (569062) | more than 9 years ago | (#10911306)

don't forget to pick up a copy of the new perl 6 book [otierney.net] !

Re:perl6 book coming soon (1)

bcrowell (177657) | more than 9 years ago | (#10913480)

Hee hee...although I appreciate the joke,
  • Perl 6 will not be not incompatible with Perl 5. It will automatically recognize Perl 5 source code and handle it appropriately.
  • I believe it's really being designed mostly by Larry Wall, not by a committee. (But he's asking other people to handle the implementation.)
  • The chimerical animal implies that the design and implentation are messy, but in fact the whole motivation for Perl 6 is to clean up the design (OO no longer bolted on) and implementation (internals had gotten too complicated).

If you go through the book in detail... (4, Funny)

kclittle (625128) | more than 9 years ago | (#10911308)

...carefully doing all the exercises, you can then go back to the first page and see that you have no idea what the first example is trying to do -- it is, after all, Perl. :)

No... What? (1)

quamaretto (666270) | more than 9 years ago | (#10911314)

It assumes no prior knowledge of Perl or of programming in general.

I don't understand. What is he talking about?

First Edition's Free (4, Informative)

enilnomi (797821) | more than 9 years ago | (#10911365)

This is a great beginner's book. And if you're a beginner with no cash it's an even better book, since the first edition is available as per-chapter PDFs. Get 'em here [perl.org] .

S2

Beginning Perl (3, Funny)

BabyJaysus (808429) | more than 9 years ago | (#10911419)

#!/usr/bin/perl -w

Re:Beginning Perl (1)

FuzzyBad-Mofo (184327) | more than 9 years ago | (#10912001)

use strict;

Re:Beginning Perl (1)

John Bokma (834313) | more than 9 years ago | (#10913018)

use strict;
use warnings;

the latter is prefered above -w switch

Perl is lame. Ruby. (-1, Troll)

Anonymous Coward | more than 9 years ago | (#10911505)

http://www.ruby-lang.org/en/

Reviewer uses Ruby (1, Informative)

Anonymous Coward | more than 9 years ago | (#10911512)

The reviewer is a frequent poster to Ruby-talk, an email list devoted to Ruby.

Re:Reviewer uses Ruby (1)

Bbazzarrakk (686141) | more than 9 years ago | (#10912621)

Before that, the review spent years answering questions on the Perl Beginner's mailing list, as long as we're keeping track.

Serious issue with left hand page printing in this (0)

Anonymous Coward | more than 9 years ago | (#10911588)

I like a nice peach sometimes :-)

Compare (0)

Anonymous Coward | more than 9 years ago | (#10911741)

Same reviewer different lang, not exactly for begginers, but I think Ruby is far better suited as 1st programming lang than "old hat perl"

Programming Ruby: The Pragmatic Programmers' Guide
http://books.slashdot.org/article.pl?sid=04/10/13/ 1843240&tid=156&tid=6/ [slashdot.org]

nope, not related to the authors...jeez

Ruby rules (1)

gregarican (694358) | more than 9 years ago | (#10912314)

As a beginning programmer I can say that between the handful of popular scripting languages Ruby is hands-down the easiest, most logical one to pick up. Most things just make sense and don't seem like bolted on pieces added on after the fact. I have checked out Perl, Ruby, C++, and Java and acknowledge that there are different tools for different jobs. But for someone starting out I've been 10 times more efficient coding applications in Ruby. Plus what other programming language can you hop on a mailing list and have your question answered in an hour or even join an IRC channel where the language's author is usually listed as being in the channel as well? Offtopic granted, but reading about a beginner's guide for Perl kind of struck a chord with me.

Re:Ruby rules (0)

Anonymous Coward | more than 9 years ago | (#10913617)

As a beginning programmer I can say that between the handful of popular scripting languages Ruby is hands-down the easiest, most logical one to pick up.

I didn't like having to program the thing in Kana and Kanji though.

Having to write my programs with an ink-brush really sucked, and the damn thing crashes if you get the strokes in the wrong order.

No prior knowledge (3, Insightful)

tootlemonde (579170) | more than 9 years ago | (#10912399)

It assumes no prior knowledge of Perl or of programming in general.

Books that assume no prior knowledge of programming should also give the student an idea of what else they need to know beside programming before they can do any real work.

A partial list would be:

  1. Database design
  2. A database application and SQL
  3. An operating system
  4. A web server
  5. cgi
  6. html
  7. version control
  8. documentation

I also recommend:

  • Debugging Perl: Troubleshooting for Programmers by Martin Brown
  • Perl Medic: Transforming Legacy Code by Peter J. Scott
  • Head First Design Patterns by Elisabeth Freeman, Bert Bates, Kathy Sierra, Eric Freeman

Also, alert the student that it takes 5 years to become proficient and every 5 years half of what he knows is obsolete.

Re:No prior knowledge (0)

Anonymous Coward | more than 9 years ago | (#10912608)

CGI is dead

My intro to perl... (1)

ShipiboConibo (808524) | more than 9 years ago | (#10912685)

<?php
echo "</PERL>\n";
?>

The author's name is James LEE and NOT (0)

Anonymous Coward | more than 9 years ago | (#10913392)

James Loo. That kind of mistake in a review is unacceptable.

Frist Stop! (-1, Flamebait)

Anonymous Coward | more than 9 years ago | (#10913588)

they 5tarted to bring your own arseholes at Walnut every chance I got move forward,
Load More Comments
Slashdot Login

Need an Account?

Forgot your password?