Is the Perl programming language useful?

In summary: I don't know if that's true or not, but it's something to think about.In summary, Perl is a text-based programming system used mostly for quick and dirty tasks, while Python is a more general purpose programming language that is good for more complex tasks.
  • #1
The_Z_Factor
71
0
Hello all, I was wondering, since I read in a document that programming is used a lot in physics work, if Perl programming was any use? I don't know much about programming or even computers for that matter all I know is that Perl is mostly a text based programming system and I assume that its not used because its not binary? I picked up a few Perl books and that helped me understand the basics, I didnt get too far into it before sending it back to the library, too much work going on at the time. But if I was to pick up a book at a library that would help me with later physics work in college, to get a basic idea, what type of programming should I try and learn? C++ or C? Any tips?
 
Technology news on Phys.org
  • #2
I would probably recommend Python over Perl for physics. Python has a number of physics-related computation and visualization modules available, such as SciPy and VPython. It would be worth learning one of C(++) or Fortran for extremely computationally intensive tasks, but for most quick and dirty computations, Python should suffice.
 
  • #3
Ah, thanks, any idea where I could find a book that could teach that? The only books my library has are JavaScript and Perl and C(++).
 
  • #4
The o'reilly book learning python is pretty good.
Or the online tutotrials http://docs.python.org/tut/
For maths there is a (free) heavy duty numerical add-in http://numpy.scipy.org/

Python is as easy to use as Perl but has rather clearer and less confusing syntax.
 
  • #5
Not so sure if I would say easy personally, haha. But thanks for the links, I'll definitely check them both out.
 
  • #6
I'm going to echo these guys on the basis of personal experiences & preferences. "Serious stuff" ~ Python (which don't require or for some reason want to do e.g. with C++ or something related)(Python is being used & taken into use all over the place with respect to physics appls), "misc scripting, data processing etc." ~ Perl. Would also highly recommend to make sure you get a compiled language like C++ to your repertoire.
 
  • #7
The_Z_Factor said:
I don't know much about programming or even computers for that matter all I know is that Perl is mostly a text based programming system and I assume that its not used because its not binary?
Perl has special capabilities that make it especially good for dealing with large text-like data sets; however it can work with "binary" and mathematics just the same as any other programming language. The difference is mostly a matter of what features of the language get the most focus.

Although I have used Perl for many years and am very fond of it, I must second (third?) the recommendation that you would be better off using Python. Python has many of the same advantages as Perl, but it is "cleaner". Perl has a lot of special rules that make it very quick and natural to use when you are writing small tools-- but, when you try to write large structured programs these special rules mostly get in the way. Also Perl is hard to learn, because the special rules make it so complicated, and it will teach you bad programming habits. Python on the other hand makes everything simple and clean and easily-organized. Python is also a good pick if you are going into physics simply because from what I hear Python has a lot of institutional support in the areas of Physics and Engineering. (Although for some reason Perl seems to be popular with Biologists!)

I DEFINITELY think that Perl/Python are better for your uses than C/C++. Those languages are a large investment, so to speak, and the ways in which that investment pays off will not be very useful to you personally. Perl and Python hide a lot of low-level things about programming from you, whereas C/C++ make those low-level things front and center. If you try to learn C/C++ you will probably spend all your time learning to be a "programmer" and very little actually getting anything done.

I don't know how best to go about learning Python though, sorry! But I have found that O'Reilly books are almost always good. If you go with O'Reilly though be careful though to get the "learning python" (is that the name?) book and not the "programming python" book, because the "programming python" book is all about advanced techniques assuming you already know the language. (I made this mistake once myself...)
 
  • #8
I don't know a thing about physics programming, so maybe I should be ignored. On the other hand, maybe not, since I'm just echoing what's already been said.

There's some quote about Perl that I just can't seem to find that basically says that the problem with Perl is that if you write a program with it and then come back to look at it the next day, you won't have a clue what its supposed to do.

Programming in Python has been one of the best experiences of my programming life. It seems to make everything easy enough and the online tutorial/documentation is great. I would definitely use it for everything if I were still programming.
 

1. Is Perl a popular programming language?

Yes, Perl is a popular programming language with a large community of developers and users. It is widely used in various industries for web development, system administration, and scientific computing.

2. What are the main features of Perl?

Perl is a flexible and powerful programming language with a wide range of features, including regular expressions, object-oriented programming, and support for multiple programming paradigms. It also has a large standard library and a rich ecosystem of third-party modules.

3. Is Perl still relevant in today's programming landscape?

Yes, Perl is still widely used and relevant in today's programming landscape. It continues to be actively maintained and updated, with the latest version being released in 2021. Many large companies and organizations still rely on Perl for their critical systems and applications.

4. Is Perl easy to learn?

Perl has a reputation for being a language that is easy to learn, especially for beginners with no prior programming experience. Its syntax is simple and readable, and there are plenty of resources available online for learning Perl.

5. What are the advantages of using Perl?

Some of the key advantages of using Perl include its flexibility, scalability, and robustness. It is also known for its efficient handling of text processing tasks and its ability to integrate with other programming languages. Additionally, Perl has a large and active community, making it easy to find support and resources for development.

Similar threads

  • Programming and Computer Science
Replies
4
Views
788
  • Programming and Computer Science
Replies
15
Views
1K
  • Programming and Computer Science
2
Replies
54
Views
3K
  • Programming and Computer Science
12
Replies
397
Views
13K
  • Programming and Computer Science
Replies
8
Views
875
  • Programming and Computer Science
Replies
16
Views
1K
  • Programming and Computer Science
2
Replies
59
Views
7K
  • Programming and Computer Science
Replies
7
Views
465
  • Programming and Computer Science
Replies
3
Views
1K
  • Programming and Computer Science
2
Replies
49
Views
3K
Back
Top