Click to See Complete Forum and Search --> : Where to learn perl?


CP
08-02-2001, 01:59 AM
That about says it. I have decided to make it my first Linux language. I already know a little VB, I mean a little. How did you guys learn perl? Any decent web sites, I would prefer printable stuff.

jemfinch
08-02-2001, 02:19 AM
I'm going to get flamed for this.

If this is your first "linux language", and you've not done much programming before, please consider (hell, just do!) learn Python (http://www.python.org/) instead of Perl.

Python is so superior to Perl as a learning language that it's almost ridiculous.

Jeremy

EyesWideOpen
08-02-2001, 02:26 AM
For printable online resources I would check the tutorials at Perl.com (http://www.perl.com).

A great book for beginners is Learning Perl by O'Reilly (http://www.oreilly.com) if you've got some extra cash.

Once you get deeper into it you'll probably want to visit CPAN (http://www.cpan.org) to get your modules.

Other linkage:
http://use.perl.org
http://www.perl.org

[ 02 August 2001: Message edited by: EyesWideOpen ]

CP
08-02-2001, 02:32 AM
Why python? I asked around a lot, not here, and was told to learn perl. Then I was told to just leap in and learn C++, but just closed my eyes and picked a point on the screen, it was closest to perl, so thats what I decided to do. Am I making the right decision? I have no cash which is why I want printable resources on the net. Thanks for the help guys.

jemfinch
08-02-2001, 02:47 AM
Perl is a monstrosity of syntax and obfuscated semantics. Python is a clean and syntactically pretty language. They're of approximately equal speed and capability. Python is just so much easier to learn, and so much more understandable (when reading others' and your own code) that there's not much reason to learn Perl these days.

At Python's website, check the "documentation" link and you'll find several versions of both the tutorial and the library reference, in some sort of printable (at least for me :)) form.

Jeremy

sincka
08-02-2001, 02:58 AM
I would have to agree with Jemfinch about Python being MUCH easier and cleaner to learn. But I would have to disagree with the power of the two. From what I've heard (since I never really got that deep into Python, freakin C++ is driving me crazy as it is) Perl is somewhat superior than Python... might be wrong and Jemfinch, correct me if I am. Perl has the capabilities of a medium/high-level language like C (actually most of the perl syntax has been borrowed from C) but is much quicker (as in less code to type) than C/
C++.

Again Python is a great learning language. Nice and clean. Perl on the other case is like trying to code in Python under lots of drugs :p

Really if you go on the net and compare the syntax of the two, you will find Python much easier to learn. Well later :p

CP
08-02-2001, 03:06 AM
Originally posted by jemfinch:
<STRONG>Perl is a monstrosity of syntax and obfuscated semantics.</STRONG>
No idea what that means but thanks. F*ck it, I'll do both I've decided. Now I have to find a way to study, and learn 2 programming languages at once.

sincka
08-02-2001, 03:26 AM
Originally posted by CP:
<STRONG>Originally posted by jemfinch:
Perl is a monstrosity of syntax and obfuscated semantics.</STRONG>
No idea what that means but thanks. F*ck it, I'll do both I've decided. Now I have to find a way to study, and learn 2 programming languages at once.


Now if you want to be special/unique :rolleyes: learn Ruby. I've never personally done any of it but you might be the next Ruby guru :p

Plus Ruby sounds kewl... :D

CP
08-02-2001, 03:46 AM
Is ruby easy. Once I set myself a goal I'll do it. I already have Perl and Python, why not ruby as well. Where do I get it from?

jemfinch
08-02-2001, 04:08 AM
Originally posted by sincka:
But I would have to disagree with the power of the two

...

Perl is somewhat superior than Python...


Perl can do absolutely nothing that Python can't do, and what it does do, Python does looking cleaner, generally.


Perl has the capabilities of a medium/high-level language like C.


C isn't a high level language. It's a low level language. Perl is a high level language, not a medium level, not a low level language.


(actually most of the perl syntax has been borrowed from C)


Actually, Perl's syntactic roots are more deeply involved in sh, sed, and awk than C. In fact, perl is a great replacement for sh, sed, and awk in combination. But for real programming, it's just not a competitor; the syntax gets in the way when a program stops being a script and starts being something that needs to be maintained and extended.


but is much quicker (as in less code to type) than C/C++.


Code economy in Perl is great, but at a large cost: code maintainability. Python has about equivalent code economy, but without the hit on maintainability.


Really if you go on the net and compare the syntax of the two, you will find Python much easier to learn. Well later :p


Absolutely. And a newbie programmer doesn't need to fight with syntax when trying to understand programming concepts (like, &lt;ahem&gt; recursion :D)

Jeremy

CP
08-02-2001, 04:10 AM
Thanks guys. I now have ruby, perl, and python istalled. And a tutorial for each. I am going to do this. Set some goals for me. Tell me something to do, suitable for a beginner, and give me a timeframe. I WILL DO IT.

jemfinch
08-02-2001, 04:18 AM
Originally posted by CP:
Set some goals for me.

First Goal: Learn Python.

Second Goal: Realize that Ruby is useless.

Third Goal: Realize that Perl is useless for anything but trivial filter generation.

Jeremy

(geez, am I in an advocacy mood tonight or what?)

CP
08-02-2001, 04:19 AM
Originally posted by jemfinch:
<STRONG>First Goal: Learn Python.

Second Goal: Realize that Ruby is useless.

Third Goal: Realize that Perl is useless for anything but trivial filter generation.

Jeremy

(geez, am I in an advocacy mood tonight or what?)</STRONG>
Wow, you really dislike anything but Python don't you. :)

EyesWideOpen
08-02-2001, 07:35 AM
Some more Perl linkage for you:

http://dmitry.dn.ua/library/oreilly/link/perl/
http://www.perldoc.org

;)

[ 02 August 2001: Message edited by: EyesWideOpen ]

Salmon
08-02-2001, 09:05 AM
Originally posted by jemfinch:
I'm going to get flamed for this.

[ . . . snip . . . ]

Python is so superior to Perl as a learning language that it's almost ridiculous.


No flames. jemfinch is right about Perl as a learning language. It's not that great, and highly confusing at best.

As far as Perl being useless and there not being a reason to learn it, that's certainly not true.

Java isn't too bad for a learning language, and while I know squat about C++, I'm thinking that it has to be a lot easier than that for sure.

(edit) Some more perl linkage . . . http://www.perlmonks.com/

[ 02 August 2001: Message edited by: Salmon ]

jemfinch
08-02-2001, 09:25 AM
Originally posted by CP:
Wow, you really dislike anything but Python don't you. :)

I think you missed my .sig :)

Jeremy

jemfinch
08-02-2001, 09:26 AM
Originally posted by Salmon:
As far as Perl being useless and there not being a reason to learn it, that's certainly not true.


Perl has a very small place: replacing one-time-use shell scripts and creating simple filters and converters. Beyond that, there are far superior languages to choose from.

Jeremy

YaRness
08-02-2001, 09:32 AM
oooo.


let's have an argument about OO languages versus natural language-like languages.

no wait, let's not. i can do searches and just read jemfinch's posts 10 times over, and get bored and go play with perl without active help.

hey, ada is a good learning and OO language too!

&lt;/butting in&gt;

Stuka
08-02-2001, 09:45 AM
LOL - Should we make a "jemfinch's language NHF"? It oughta be easy considering how many posts we could add together! And really, jemfinch, when are you &lt;b&gt;NOT&lt;/b&gt; in an advocacy mood? :rolleyes:

Salmon
08-02-2001, 09:45 AM
Originally posted by jemfinch:
<STRONG>Perl has a very small place: replacing one-time-use shell scripts and creating simple filters and converters. Beyond that, there are far superior languages to choose from.</STRONG>

So what your saying then is that all the development activity on Perl 6, Perl modules, etc is largely useless and only has a small place? Are you saying that the current amount of Perl code floating around is useless as well so there's really no reason to learn Perl.

And at risk of escalating this into a larger battle -- there are quite a few people who would certainly argue that Python's place is small compared to that of Perl's.

YaRness
08-02-2001, 10:03 AM
jeremy just needs deflating every now and then.

<A HREF="http://www.linuxnewbie.org/cgi-bin/ubbcgi/ultimatebb.cgi?ubb=get_topic&f=14&t=001166" TARGET=_blank>
bighara: Is Python a good language to learn too?"
jeremy: "From a perl monger: No."</A>


Originally posted by jemfinch: (http://www.linuxnewbie.org/cgi-bin/ubbcgi/ultimatebb.cgi?ubb=get_topic&f=14&t=001135)
<STRONG> Despite my hate for python and its OO disgustingness, and the fact that I rarely try to actually recommend one language over another language that someone really wants to learn, I have to say, "Learn Perl" here.

Even people who hate perl know that it's absolutely perfect for what you want to do.

Even people who love python know that perl would kick python's slow object oriented rear at this.

For string manipulation, nothing can beat perl -- regular expressions are the language of strings, not to mention the myriad modules and such that make html parsing and various other forms of parsing simpler than dirt. In python, regular expressions may have the power of perl regular expressions, but they're far less natural to use -- you have to explicitly compile them; you have you throw in numerous backslashes just for good measure; and I seriously doubt (unless they've linked with pcre) that they're as fast as perl's regular expressions (which are second to none, except the GNU grep utilities).

You're begging to learn Perl. Your post reeks of perl propaganda "Q&A" type stuff. You want perl.

With that said, buy Learning Perl and Advanced Perl Programming (or, since string manipulation is your only goal, perhaps the drier-but-more-focused Mastering Regular Expressions could be nice.)

But please, learn perl. Python isn't for this job.

(python isn't for any job, but that's a different story... http://www.linuxnewbie.org/ubb/smile.gif )

Jeremy</STRONG>

[ 02 August 2001: Message edited by: YaRness ]

Salmon
08-02-2001, 10:22 AM
That's kind of funny. Here's one more recent . . .


Originally posted by jemfinch (http://www.linuxnewbie.org/cgi-bin/ubbcgi/ultimatebb.cgi?ubb=get_topic&f=14&t=003389)
That's right, Perl is designed for serious programming of all kinds, not just web applications.

YaRness
08-02-2001, 10:38 AM
ROFL.

try s/perl/python/

look familiar?

kel
08-02-2001, 12:02 PM
Jeremy,
You say that Python can do anything that Perl.
What can Python do that Perl can't???

I love to see Python people get all pissed off when people start talking about Perl...it just makes my day.

satchel
08-02-2001, 12:03 PM
...here is my 2 cents. I would learn Perl if your gonna pursue a career in unix administration/programming. Alot of people are writing Perl scripts now to replace ksh,csh or bash scripts due to its cross-platform abilities. If you want to do OO application development why not try Python? This would give you a good base in OO concepts if you ever moved onto C++ or Java.

JasonC
08-02-2001, 02:36 PM
Originally posted by kel:
<STRONG>Jeremy,
You say that Python can do anything that Perl.
What can Python do that Perl can't???

</STRONG>

As a dabbler in both, I say Python can make sense. Just about anyone can read Python code and figure it out. Perl looks like some ancient text mixed with symbolic nonsense. But, Perl is definitely in demand right now.

jemfinch
08-02-2001, 03:21 PM
Originally posted by Salmon:
So what your saying then is that all the development activity on Perl 6, Perl modules, etc is largely useless and only has a small place?


Yes. People are just stubborn, and oftentimes want to develop in a certain language. For some people, that language is Perl. A fair indication of Python's superiority over Perl is that, as ESR puts it, the "brain drain" between the two (ie, the number of people switching from one to the other) is almost entirely in Python's favor.


Are you saying that the current amount of Perl code floating around is useless as well so there's really no reason to learn Perl.


For most any task out there, the modules in Python's standard library are sufficient. If that's not enough, Python has numerous third-party modules. I would be surprised to find a significantly useful module that Perl has that Python doesn't, but feel free to offer some.


And at risk of escalating this into a larger battle -- there are quite a few people who would certainly argue that Python's place is small compared to that of Perl's.


Yes, but those people are probably almost exclusively people who know Perl and love it because it's their only high-level language. They just don't know any better. I was there once.

Now for a little of "responding to myself when I wasn't quite as enlightened" action.

Originally posted by &lt;ahem&gt; jemfinch:
For string manipulation, nothing can beat perl -- regular expressions are the language of strings, not to mention the myriad modules and such that make html parsing and various other forms of parsing simpler than dirt.


I've now done much string manipulation and html parsing in both languages, and prefer the Python for all but one-line filters (especially those that have to edit files in-place.) The indexability/slicability of strings is a big win for Python, since oftentimes what would take a regexp or an ugly substr call can be done easily via standard sequence slicing, faster.


In python, regular expressions may have the power of perl regular expressions, but they're far less natural to use -- you have to explicitly compile them; you have you throw in numerous backslashes just for good measure; and I seriously doubt (unless they've linked with pcre) that they're as fast as perl's regular expressions.


Ah, wrong on three counts. Regular expressions in Python don't have to be explicitly compiled (although such is definitely allowed for optimization purposes, as in Perl.) They don't require any more backslashes than in perl (use raw strings, r'') and they are implemented with a modified PCRE. In fact, Python regular expressions even offer one feature Perl's don't: named backreferences. It's spiffy.

I think it's great that you can find posts where I advocate Perl for lack of knowledge of Python or other languages, but I have to say that I think it's of limited utility. I learned Python after knowing Perl really well in order to put down the Python advocates. You can see how well that worked out :)

Originally posted by me, more recently:
That's right, Perl is designed for serious programming of all kinds, not just web applications.


Way to take a quote out of context :) When compared to PHP, Perl is "designed for serious programming", as opposed to PHP's "just for web applications" approach. It doesn't mean Perl is the best language, or even good, at "serious programming", just that it's designed for it.

Originally posted by kel:
Jeremy,
You say that Python can do anything that Perl.
What can Python do that Perl can't???


Be readable. Be maintainable. Not worry a programmer over spurious spawnings of shells. Be easily and provably cross-platform. Map directly from brainwaves to code with as few speedbumps as possible.

Originally posted by Stuka:
And really, jemfinch, when are you &lt;b&gt;NOT&lt;/b&gt; in an advocacy mood?


I've been trying to tone myself down lately, actually. But when I'm in a bad mood, or have a bad night at work, advocacy is my medecine: it's therapeutic for me to preach about my preferences and almost feel as if I have a captive audience :D

Actually, I would feel really bad if someone stumbled into learning Perl as one of their first languages because no one spoke up and advised them of the alternatives. Too many programmers go through their programming careers/hobbies with such a limited knowledge of the advantages/disadvantages of different languages that I shudder to think of the pain they go through using the wrong language for a job.

Jeremy

EyesWideOpen
08-02-2001, 04:21 PM
In the midst of all this Perl-or-Python madness comes another Perl link choc full of goodies:
http://www.possibility.com/Perl/

kel
08-02-2001, 05:12 PM
jeremy,
you keep saying the Perl has nothing that Python doesn't have also. On the flipside, there's nothing that Python has the Perl doesn't.

Your statements of ease of use, readability and other such arguments of arguments of preference, grounded really in your own opinions and nothing else. Your lack of ability to read Perl code is not mine, my preference for Perl syntax is not yours. To try and convince anyone that there's only one programming language well suited for any given set of tasks is silly.

To show you how this entire argument is based on preference:
I prefer Perl to Python because of its:
-Compactness
-Readability
-Regular Expression support(Yes I know Python supports regular expressions, I just don't like how)
-Polymorphic nature when it comes to OOP.
-Idiomatic nature
-Flexibility(as far as how compact you choose to write your code)

That's just my opinion. :D

[ 02 August 2001: Message edited by: kel ]

jemfinch
08-02-2001, 11:40 PM
Originally posted by kel:
you keep saying the Perl has nothing that Python doesn't have also. On the flipside, there's nothing that Python has the Perl doesn't.


Clean, easy, highly consistent syntax? A clean and useful Object model? The ability to do metaclass programming with ease? Do these mean nothing to you?


Your lack of ability to read Perl code is not mine


I don't lack the ability to read Perl code at all. I'm very experienced with Perl, and probably one of the more experienced and knowledgable Perl coders here. It's that experience and knowledge that on which I base my disdain for Perl.


To try and convince anyone that there's only one programming language well suited for any given set of tasks is silly.


Sure it is. I've been saying that Perl has its domain and Python has its domain. It's only that the parts of Perl's domain where Python isn't superior to Perl are very small. One-shot shell scripts and tiny filters are about it.


I prefer Perl to Python because of its:
...
-Readability


Surely you jest.


-Regular Expression support(Yes I know Python supports regular expressions, I just don't like how)


Oh, you mean you can't stand typing "re.sub(regexp, replacement, text)" instead of "$text =~ s/regexp/replacement/;"? Please, detail the ways in which you dislike Python's regular expression support.

[/quote]
-Polymorphic nature when it comes to OOP.
[/quote]

You obviously have no idea what you're talking about.

No, that's not ad hominem, that's a simple fact; you don't have any idea what you're talking about if you think Perl's object model is in any way better than Python's.


-Flexibility(as far as how compact you choose to write your code)


I'm all for flexibility when it doesn't affect my ability to program in a language and my ability to read others' code in a language. In Perl, it does.


That's just my opinion. :D


Well it obviously wasn't fact :)

Jeremy

[ 02 August 2001: Message edited by: jemfinch ]

Salmon
08-03-2001, 09:17 AM
I really didn't mean to turn this into a Perl vs. Python war.

Jeremy, I know that you can read and write Perl with the best of them. I know that you're a highly skilled Python wrangler. My point was, and still is, that to say that Perl has a small place is ludicrous.

I know squat about Python. I'm looking forward to finding time to change that, and I've countless Perl scripts that I can try to convert for learning aids. If all that you say is true, then perhaps Perl will go the way of the buffalo. By your own admission, people are stubborn, and it's going to be a long time before it happens. Until then, Perl's place is certainly not small.

And a small note about Perl's readability . . . it might not be a beautiful as Python, but it doesn't have to be *that* bad. It's only as messy and unmaintainable as you let it get (with some exceptions).

jemfinch
08-03-2001, 09:46 AM
Originally posted by Salmon:
My point was, and still is, that to say that Perl has a small place is ludicrous.


There's a little distinction to be made: I mean Perl's proper place is small. Let me show by way of ASCII art :)

Here's the domain of Perl:

|-----------------------------------|

And here's the domain of Python:

|----------------------------------|

What I'm saying is that while Perl's real, workable domain may be large, most of it is also in the domain of Python. And in the intersection of their domains, Python is the superior language, IMO. When I say "Perl's place is small," I mean that the place where it's properly chosen as the appropriate implementation language is very small. Sure, it can be used for a wide array of activities, but the activities for which it is the proper tool is actually quite small.


countless Perl scripts that I can try to convert for learning aids.


Just as a note, that's one of my favorite ways to learn a language. When I started learning O'Caml, I wanted to write my Python IRC bot in it. However, the IRC bot is based on several of Python's standard modules for which there is no equivalent in O'Caml. It's a testament to Python's emminent readability that I not only translated my own code into O'Caml, but I've now translated several of Python's standard modules (asyncore, asynchat, string, os, socket, fnmatch, and glob, specifically :)) into O'Caml.

(as a note, I also did translate Perl's Text::Soundex module into O'Caml and Python for speed comparison; it wasn't nearly as easy to translate (nor is it as complex a module) as the Python modules were.)


If all that you say is true, then perhaps Perl will go the way of the buffalo. By your own admission, people are stubborn, and it's going to be a long time before it happens.


Yeah, I don't disagree that Perl is here to stay. I'd write in Perl until my fingers turned numb before I'd break out sh/awk/sed. To me, Perl is a portable sh.


Until then, Perl's place is certainly not small.


Ah, yes, but it should be :)


And a small note about Perl's readability . . . it might not be a beautiful as Python, but it doesn't have to be *that* bad. It's only as messy and unmaintainable as you let it get (with some exceptions).


My major point is that if you collect highly experienced Python coders, or highly experienced LISP coders, or highly experienced C coders for Python Mongers or C Mongers or LISP Monger meetings, you won't be discussing syntax. Syntax, to those people, will be something they don't even think about; they'll be way beyond that. But at a Perl Mongers meeting with similarly experienced Perl coders, you'll always discuss syntax, and problems based on that syntax, probably for a significant amount of time. Other languages have the advantage that at some point a programmer gets the syntax and from then on doesn't have to work to understand anything but the most obfuscated code. Perl, if it does have such a point, has placed that point beyond the reach of mere mortals.

(I used to go to Perl Mongers meetings with the current Vice President of the FSF, Bradley Kuhn. He did his master's work at the University of Cincinnati on the subject of compiling Perl to the JVM. Even he would go "Huh?" at some of the constructs people (especially Kragen Sitaker) brought up.)

Jeremy

CP
08-04-2001, 03:51 AM
I think I just started a flame war. Whoops.

alfredo
08-04-2001, 04:24 PM
I started Perl, but I am starting to see Python as something I want to try. It does look easier. I would play around with Perl and Python and see which one feels right.

Salmon. My wife used to live in Nashville. She was cashier at the Pancake Pantry until mid of last year. She loved the town. She lived within walking distance of Bongo Java.
Belmont and Cedar (http://home.infinet.mindspring.com/~arm3/hangingfoliage.jpg)

takshaka
08-04-2001, 05:03 PM
Originally posted by CP:
I think I just started a flame war. Whoops.

No, this (http://groups.google.com/groups?hl=en&safe=off&th=65a9c6564871f91f,331&start=0) is a proper Perl/Python flame war--much more entertaining.

[ 04 August 2001: Message edited by: takshaka ]

david
08-05-2001, 01:53 PM
I want to use OOP in PHP!!!

/me watches silently as jemfinch turns red and holds his breath until david says otherwise...