LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-23-2004, 05:32 PM   #1
JJX
Member
 
Registered: Mar 2004
Location: Greece
Distribution: Debian
Posts: 351

Rep: Reputation: 31
Perl or Python


I hope this post will not begin a flame....

Learning python requires past knowledge of perl??

Which is the main use of python? I can do everything i do with perl using python? Or their use is tottaly different?

A begginer what should learn first (your opinion)?
 
Old 10-23-2004, 05:57 PM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 680Reputation: 680Reputation: 680Reputation: 680Reputation: 680Reputation: 680
I would recommend you look at perl first. Not because of comparative features between the two languages, but simply because pearl is the language that many of the /sbin scripts are written in. As far as I know, most distro's use perl for their startup scripts. For Linux, pearl is the script language used for system administration tasks, aside from bash scripting. It is used when the task would be unrealistic for a 'sed' script for example.

If you are interested in 3D modeling and animation, and use the blender program from blender3d.org, then you will want to learn Python.
 
Old 10-23-2004, 06:34 PM   #3
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
Quote:
Originally posted by jschiwal
I would recommend you look at perl first. Not because of comparative features between the two languages, but simply because pearl is the language that many of the /sbin scripts are written in.
Though I choose to start learning Python myself (I'm already familiar with C, C++,PHP), I think you have a point here.

Quote:
As far as I know, most distro's use perl for their startup scripts.
I'm not so sure about that.
At least for Debian and SuSE I know it's not true.

Pro perl:
- A lot of existing scripts on many systems.
- Probably a larger amount of existing, ready to use, modules than Python (CPAN)

Pro Python:
- Python is a, newer, fast growing alternative to perl.
- Arguably cleaner code.
 
Old 10-23-2004, 10:58 PM   #4
johnMG
Member
 
Registered: Jul 2003
Location: CT, USA
Distribution: Debian Sarge (server), Etch (work/home)
Posts: 601

Rep: Reputation: 32
> Learning python requires past knowledge of perl??

No

> Which is the main use of python? I can do everything i do with
> perl using python? Or their use is tottaly different?

Python seems to me to be more general-purpose. I think Perl is more easily used for system admin tasks that make heavy use of text processing.

> A begginer what should learn first (your opinion)?

Depends on what you want to do with it. Learning both was confusing for me (hard to keep them separate, in my mind anyway).

Perl is quirkier and has a context-sensitive syntax. Perl is fun, especially if you like programming for programming's sake. Python is simpler (IMO), slightly more verbose, arguably easier to read and maintain, and has OO baked right in from the start.

Perl has phenomenally good books available for it (I'm thinking of Oreilly's "Perl Cookbook". Larry's book is awesome, and "Learning Perl" is just great). Python docs are (IMO) only alright.

Perl is heading for some changes when (if?) Perl6 gets here. My guess is that most Pythoners/Pythonistas are pretty happy with Python the way it is.

BTW, there's also Ruby. Ruby seems to be a highly-evolved Perl replacement that is supposed to feel like Perl but (to my untrained eye) looks like Python. I only very briefly glanced at Ruby.

Last edited by johnMG; 10-23-2004 at 11:07 PM.
 
Old 10-26-2004, 02:46 PM   #5
JJX
Member
 
Registered: Mar 2004
Location: Greece
Distribution: Debian
Posts: 351

Original Poster
Rep: Reputation: 31
i am going for perl

thx for your help
 
Old 10-26-2004, 05:35 PM   #6
neilman
Member
 
Registered: Oct 2004
Location: Northville, MI
Distribution: Slackware
Posts: 65

Rep: Reputation: 15
If you're just learning Perl, don't run out and buy a thousand books. You can empty your wallet quick on some horrendous compilations. Try your local library first. In fact, a local university here in Detroit has a load of books including topics like MySQL, PHP, and Perl. You can find many guides and tips/tricks online. But, just for the record, one of the best books I've ever read, and have purchased a number of copies for friends, is Perl by Example by Ellie Quigley. Just FYI, there are newer editions that are quite large. The one that I'm referring to (or have experience with) is a very very small thin volume, but man, you can actually learn Perl without sitting in front of a computer. She actually presents the source code, explains it line by line. Then, she executes the program and shows the output, and explains that line by line. It's really a swell book for a beginning Perl programmer.
 
Old 10-27-2004, 03:58 AM   #7
JJX
Member
 
Registered: Mar 2004
Location: Greece
Distribution: Debian
Posts: 351

Original Poster
Rep: Reputation: 31
I was thinking buying "Learning Perl, Third Edition" (oreilly)
But perl by example looks nice

I have to search better before buying
http://www.codebits.com/p5be/ --> this you mean?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Advice on PERL vs. Python servnov Programming 5 10-02-2005 02:59 PM
Python or Perl? Boby Programming 2 06-12-2005 10:54 AM
bash, perl, or python? s_siouris Linux - Software 11 05-13-2005 03:15 PM
Perl or Python ! linuxlover1 Programming 13 04-19-2004 07:33 AM
Perl or Python to C++ compiler JHuizingh Programming 0 07-16-2002 11:36 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:26 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration