To view parent comment, click here.
To read all comments associated with this story, please click here.
"In python, a regexp is a second class object. In perl, a regexp is a first class object. Anyone with proficiency in *both* languages will agree with you."
Well, if you consider regexp build into the syntax a better solution, then I guess perl is ahead. I don't find Pythons regexp hard to use and I like the design where you don't cram things like regexp into the language, but keep it in a module.
It will make me type a little bit more, but it also means I usually understand my code better than in perl anyway.
Having said that, I'm not using Python for system administration much. The simple things that I need to do can be done in shell scripts just as well as in Python. The times I use Python is when things should run automatically and a "Permission denied" printed to stderr just isn't enough error handling.
Python has exception handling and perl doesn't. You have just hit on an area that Python tromps perl about a millionfold. Python's OO is also not a pain to deal with as it is truly integrated into the language.
That said, Linux systems administration is mostly just dealing with text files and text streams. For that alone, perl will always beat python.






Member since:
2005-11-05
Use the best tool for the job. In text processing, perl beats python.
In python, a regexp is a second class object. In perl, a regexp is a first class object. Anyone with proficiency in *both* languages will agree with you.
I love python, but it doesn't make sense for managing "Unix" systems. If the title of the article was, "Why You Should Adopt Python to Manage Linux Systems", I would agree.
You can't always install something as large as python due to business processes or technical requirements. When your company has been managing systems a similar way for 10 years, they might not like to change. (Not reflective of my current job, but true for my previous one.)
Edited 2007-09-15 02:30