Compare and contrast Perl v Python


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Compare and contrast Perl v Python
# 1  
Old 08-09-2013
Compare and contrast Perl v Python

Anyone care to give me the cliff notes as to why one would want to use perl vs python? Unix Solaris over here. Have capability to run both perl and python and bash/ksh and others.

Now what I am interested in using unix and its programs for large amounts of data, sql (done in Unix SAS)...etc. Lots of cleansing, analytics, algorithms to do research, etc.

I am more of a analytics kind'a worker than IT, but I understand all the IT'ness of these programs (I learned C++ and java in school, so this object based stuff is familiar to me, though sql, sas and data pull/shape/analyze tools are more my cupp'a tea though). I want to make sure I don't miss leveraging what I could use to make some great data finding, cleanse, etc....

I have learned a couple python scripts here (thanks to you all) and am now wondering, what's the whole N of these languages as folks might use for sql, analytics, data pull, extract, etc....

Just freeform thought, it's Friday - keep it light, fun! Take care!
# 2  
Old 08-09-2013
One advantage of Perl is that it is part of the standard installation of Solaris. It means that there are more scripts/one-liners on unix.com in Perl that might help solve problems you might encounter.

Another thing is what I mentioned in the last sentence: one-liners. Perl can be used as a more powerful replacement for any text manipulation tool in Unix (grep, awk, sed,...). As far as I know it is not possible with Python.
# 3  
Old 08-10-2013
If you are using SAS already you are probably better off continuing to use that. There almost nothing SAS cannot do, whatever data you throw at it. It sounds like you have big data and even if you do want to step away from SAS, you would probably want to lean towards Python, because it appeals to the high performance community and are more likely to get help there.
# 4  
Old 08-10-2013
Python is fully interactive by default and one can work from a Python prompt directly.

Just enter
Code:
python<CR>

from a terminal and away you go...

Perl OTOH can be set to an interactive environment by invoking the debugger but I have no serious experience on this language at all; just enter
Code:
perl -de 1<CR>

and you will have an interactive seesion.

Python relies entirely on indentation for correct operation, so beware, do NOT mix say 8 spaces with a tab inside the same indented code piece...

The python error reports, (tracebacks), are IMO excellent...

As I have little or no experience in perl then I can't comment....
# 5  
Old 08-10-2013
A pithy oneliner:

Perl is the past, python is the future!
# 6  
Old 08-11-2013
Quote:
Originally Posted by figaro
If you are using SAS already you are probably better off continuing to use that. There almost nothing SAS cannot do, whatever data you throw at it. It sounds like you have big data and even if you do want to step away from SAS, you would probably want to lean towards Python, because it appeals to the high performance community and are more likely to get help there.
I agree! I've been using SAS Windows for years, now after learning how to run it on unix, I've a whole new world of "bag'a tricks" that I can throw at these data! How on earth have I been living all these years not leveraging unix with SAS?! Python's some great cleansing abilities! Geeezzzzz, I'm enlightened folks. This is a groundbreaking way to see data on a unix box.....I know this is nothin new to you all Smilie

Ken Thomson, Denis Ritchie, et al....hats off to you all and this community!
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Can someone convert this python script to perl

There is a python script that I would like converted to a perl script. If someone has the time to convert the script I would appreciate it. You can find the script below: reboot-mb8600/reboot-mb8600.py at master . j4m3z0r/reboot-mb8600 . GitHub #!/usr/bin/python ''' A hacky script to... (1 Reply)
Discussion started by: azdps
1 Replies

2. Shell Programming and Scripting

Python/Perl/Shell ??

Hi All, I'm confused what to use (Python/Perl/Shell), I have a scenario here wherein i need to process a data which might have millions of records in tabular format, my task is to find the {0,null,NA} in each and every column and also inform the end user that this column has this many values... (2 Replies)
Discussion started by: nikhil jain
2 Replies

3. Homework & Coursework Questions

[Python] Compare 2 lists

Hello, I'm new to the python programming, and I have a question. I have to write a program that prints a receipt for a restaurant. The input is a list which looks like: product1 product3 product8 .... In the other input file there is a list which looks like: product1 coffee 5,00... (1 Reply)
Discussion started by: dagendy
1 Replies

4. Shell Programming and Scripting

perl, python, or ? for a particular task

I have a client that needs some data downloaded from a website periodically. The problem is that the data is not available directly (i.e. ftp) and must be accessed via logging in to the site, selecting the data manually, then finally clicking a link to grab the zip file. The site does not have an... (2 Replies)
Discussion started by: shunk wugga
2 Replies

5. Programming

Python: Compare 2 word lists

Hi. I am trying to write a Python programme that compares two different text files which both contain a list of words. Each word has its own line worda wordb wordc I want to compare textfile 2 with textfile 1, and if there's a word in textfile 2 that is NOT in textfile 1, I want to... (6 Replies)
Discussion started by: Bloomy
6 Replies

6. Shell Programming and Scripting

Perl Vs Python

Hello all, I am in a bit of dilema here. I want to implement a suite. it involves a lot of text file processing and shell scripts . which one to use perl or python ? (4 Replies)
Discussion started by: achak01
4 Replies

7. Shell Programming and Scripting

Help with Simple Perl/Python Script

I have the following problem, which I need done in Perl/ or Python using Unix/linux filters... 1. You have a very large file, named 'ColCheckMe', tab-delmited, that you are asked to process. You are told that each line in 'ColCheckMe' has 7 columns, and that the values in the... (1 Reply)
Discussion started by: Swapnilsagarwal
1 Replies

8. Shell Programming and Scripting

Perl to Python

Friends How to convert this perl notation to Python ${$$hashptr{$sys_Id}}{$doc_Id} = $docstr; Jagan (0 Replies)
Discussion started by: jaganadh
0 Replies

9. Shell Programming and Scripting

Perl style i++ in Python

friends Is it possible to implement perl style autoincriment in python? e.g i++ How it can be represented in python Jagan (1 Reply)
Discussion started by: jaganadh
1 Replies
Login or Register to Ask a Question