What do people mean when they say: "Perl is very well versed"?

What do people say when they say: "Perl is very well versed"?

How is Perl better or stronger than other scripting languages ​​like Python or Ruby?

+6
scripting perl parsing scripting-language text-parsing
source share
5 answers

They mean that Perl was originally designed to process text files and has many features to make it easier:

  • Perl has many functions for processing strings: substr , index , chomp , length , grep , sort , reverse , lc , ucfirst , ...
  • Perl automatically converts numbers and strings depending on how the value is used. (for example, you can read the character string "100" from a file and add it to it without first having to convert the string to an integer conversion)
  • Perl automatically handles the conversion to and from the encoding of the platform (for example, CRLF on Windows) and the logical new line ("\ n") in your program.
  • Regular expressions are integrated into the syntax instead of a separate library.
  • Perl regular expressions are the gold standard for power and functionality.
  • Perl has full Unicode support.

Python and Ruby also have good word processing capabilities. (Ruby, in particular, was very inspired by Perl, as Perl shamelessly borrowed from many other languages.) There is little point in asking what is best. Use what you like.

+18
source share

Do not take the statement about the power of Perl as a statement about the flaws of another language. Perl is good for text processing, but that does not mean that Ruby or Python sucks.

When people say Perl is β€œgood for parsing,” they basically echo Perl's stories; It was invented on the day when complex text processing was not easy. Try to make some of them in C or C ++ (Java has not yet been invented!). Larry tried to do his work with sed and awk that day, but ran into their limitations. He made a tool that made it easier to work with text.

Perl is still very good for word processing tasks, but now there are so many other languages.

+11
source share

Perl is good for ETL moves or batch processing. This is the minimum code for selecting a file; press split to get a map , perform some logical business actions on the record, and write them back to disk.

I believe that more data processing than data parsing, but data processing is parsing massive data.

+4
source share

Perl is very good at parsing text compared to C / C ++ / Java.

+1
source share

Probably because people are used to what they were created for, as described in the perl documentation , so it has become commonplace for many to associate parsing of text files with Perl. Not to exclude Ruby or Python, this is just the name of the IMHO home name.

Perl is a language optimized for scanning arbitrary text files, extracting information from these text files, and printing reports based on this information. It is also a good language for many system management tasks. The language should be practical (easy to use, effective, complete), and not beautiful (tiny, elegant, minimal).

0
source share

All Articles