Perl for a Python programmer

I know Python (and a bunch of other languages) and I think it might be nice to learn Perl, even if it seems that most of the people is doing it the other way around.

My main concern is not about the language itself (I think that part is always easy), but about learning the Perlish (as contrasted with Pythonic) way of doing things; because I don't think it'll be worth the effort if I end up programming Python in Perl.

So my questions are basically two:

  • Are there many problems/application areas where it's actually more convenient to use Perl rather than Python?
  • If the first question is positive, where can I found a good place to get started and learn best practices that is not oriented to beginners?


Asked by: Kevin598 | Posted: 06-12-2021






Answer 1

One area where Perl is more "convenient" is using it for one liners. Python can be used to produced one liners, but often its "clunky" (or ugly). Note that Perl is renowned for its "terseness" or "short and concise", often at the expense of readability. So coming from Python, you have to learn to get used to it.

Another area is Perl's vast number of modules in CPAN. The equivalent of that is Pypi but its modules are not as many as CPAN.

that said, both do similar things and both have their own merits.

As for your second question, you can look at Perl documentation. I find it very useful. Especially also read the Perl FAQ. They are the best resource for myself if I want to learn about Perl.

Answered by: Freddie721 | Posted: 07-01-2022



Answer 2

For best practices, check out Perl Best Practices by Damian Conway. Not all of the recommended practices make sense, but most of them do.

The Perl::Critic module also helps with best practices.

Also, check out the Modern Perl Books blog.

If you have questions, Perlmonks is the best web forum to get help. There are a large number of very knowledgeable, friendly people who can, and will, answer your questions and discuss the merits of different approaches.

Answered by: Adelaide199 | Posted: 07-01-2022



Answer 3

Answered by: Miller139 | Posted: 07-01-2022



Answer 4

Impatient Perl

One of my favorite books for people who want to learn it and then get stuff done is Impatient Perl by Greg London, a free netbook available from perl.org. If you're a programmer, know scripting, know the concepts behind dynamic languages, and just want to know how perl does it, this is a great starting resource.

Answered by: Emma486 | Posted: 07-01-2022



Answer 5

I think Learning Perl from O'Reilly Media is a pretty good way to get started with Perl, even if you are already proficient in Python.

Especialy if you want to get to know the one-liner stuff (and this is what Perl is REALLY good at)

Answered by: Owen763 | Posted: 07-01-2022



Answer 6

Effective Perl Programming is mostly for people who know the basics of Perl's syntax but need to learn the idioms. We also cover similar stuff in our Effective Perler blog :)

Answered by: Cherry199 | Posted: 07-01-2022



Similar questions

Python for a Perl programmer

I am an experienced Perl developer with some degree of experience and/or familiarity with other languages (working experience with C/C++, school experience with Java and Scheme, and passing familiarity with many others). I might need to get some web work done in Python (most immediately, related to Google App Engine). As such, I'd like to ask SO overmind for good references on how to best learn Python for someone w...


C++ or Python for C# programmer?

Closed. This question is opinion-based. It is not c...


Python for C++ or Java Programmer

I have a background in C++ and Java and Objective C programming, but i am finding it hard to learn python, basically where its "Main Function" or from where the program start executing. So is there any tutorial/book which can teach python to people who have background in C++ or Java. Basically something which can show if how you were doing this in C++ and how this is done in Python. OK i think i did not put the que...


Python for a Perl programmer

I am an experienced Perl developer with some degree of experience and/or familiarity with other languages (working experience with C/C++, school experience with Java and Scheme, and passing familiarity with many others). I might need to get some web work done in Python (most immediately, related to Google App Engine). As such, I'd like to ask SO overmind for good references on how to best learn Python for someone w...


python - how real programmer do server loop?

everytime when running this program, I hear my cpu fan is boosting. I suspected the busy waiting while loops in the code is the cause. I wonder how a real programmer will do to optimize this? from multiprocessing import Process, Queue import threading class PThread(threading.Thread): def __init__(self): threading.Thread.__init__(self) #view leave will set this event self.event =...


Python Programmer test

Closed. This question does not meet Stack Overflow guid...


python - Noob programmer can't figure out simple issue

Closed. This question needs debugging detai...


vba - Resources for Python Programmer


Now that Python 2.6 is out, what modules currently in the language should every programmer know about?

A lot of useful features in Python are somewhat "hidden" inside modules. Named tuples (new in Python 2.6), for instance, are found in the collections module. The Library Documentat...


Advice for C# programmer writing Python


C++ or Python for C# programmer?

Closed. This question is opinion-based. It is not c...


Python for C++ or Java Programmer

I have a background in C++ and Java and Objective C programming, but i am finding it hard to learn python, basically where its "Main Function" or from where the program start executing. So is there any tutorial/book which can teach python to people who have background in C++ or Java. Basically something which can show if how you were doing this in C++ and how this is done in Python. OK i think i did not put the que...


java - asm / C / Python / Perl / Lisp / Scheme Programmer looking for something new to learn

Closed. This question does not meet Stack Overflow guid...


Python for a Perl programmer

I am an experienced Perl developer with some degree of experience and/or familiarity with other languages (working experience with C/C++, school experience with Java and Scheme, and passing familiarity with many others). I might need to get some web work done in Python (most immediately, related to Google App Engine). As such, I'd like to ask SO overmind for good references on how to best learn Python for someone w...


Newbie Python programmer tangling with Lists

Here's what I've got so far: # A. match_ends # Given a list of strings, return the count of the number of # strings where the string length is 2 or more and the first # and last chars of the string are the same. # Note: python does not have a ++ operator, but += works. def match_ends(words): counter = 0 for word in words: if len(word) >= 2 and word[0] == word[-1]: counter += counter retur...


php - Old desktop programmer wants to create S+S project

I have an idea for a product that I want to be web-based. But because I live in a part of the world where the internet is not always available, there needs to be a client desktop component that is available for when the internet is down. Also, I have been a SQL programmer, a desktop application programmer using dBase, VB and Pascal, and I have created simple websites using HTML and website creation tools, such as Frontpage...


Proper way to do session handling in Python + Pylons for a php programmer

I'm a php programmer who's just getting started with Python. I'm trying to get Python to handle login/logout via database-stored sessions. Things work, but seem inconsistent. For example, sometimes a user isn't logged out. Sometimes users "switch" logins. I'm guessing this has something to do with thread-safety, but I'm just not sure where to begin on how to fix this. Any help would be appreciated. Here's what I hav...






Still can't find your answer? Check out these communities...



PySlackers | Full Stack Python | NHS Python | Pythonist Cafe | Hacker Earth | Discord Python



top