Good day! I would like to know whether it is worth studying Perl. What are its functionality, application and purpose?
- Here are a lot of people compare the pearl and python. - avp
- 3In the past millennium, I saw a Python site, which had an animated gif on a page: there is a camel in the center, a green serpent flies to the left, knocks the cattle on its side and knocks it out of the picture. - alexlz
- @alexlz, in general, the way it is. But in some areas he continues to hold positions. And some large offices, such as Yandex or Mail.ru, constantly have vacancies for pearl-barley programmers. But if there is no special need, I would not recommend it for studying in the first stage. - skegg
- What confuses me most about the abundance of very cleverly written scripts with powerful regular expressions (and no comment on how this works). The impression that this competition is "skilllomery". - avp
- oneWell yes. In the world of pearl is considered, the more intricate the script is written, the better.))) - skegg
10 answers
http://ru.wikipedia.org/wiki/Perl
For me, this is a very convenient and simple language. My favorite )))
- And why does pearl have a different attitude to the
$l
variable and the$a
variable? Or what value will be in the arithmetic expression zero, and in logical - the truth. (-w, of course it should be) - alexlz - Also $ b. The fact is that the variables a and b are used by Pearl when sorting, respectively, it is not recommended to use them in the program for something else, but it is possible. An arithmetic zero will be 0, as it is not strange. Logically, any value other than 0 or undef. - 2Roman
- The first question is the correct answer. Second, I paraphrase. Substitute the value of the $ c variable so that the script produces the result 1 perl -we '$ c = <substitute here>; if ($ c) {print 1 + $ c} ' - alexlz
- I wonder how in this window so beautiful code to select? )) perl -we '$ c = 0; if (defined $ c) {print 1 + $ c} ' - 2Roman
- Indentation at the beginning of the line and empty lines around (at least before). perl -we '$ c = q {0E1}; if ($ c) {print 1 + $ c} '# or perl -we' $ c = q {0E1}; print 1 + $ c if $ c 'The exponent can be anything. Seemed to be used somewhere in DBI :: something-there. If 0E0 - the request is executed, but the result is 0 lines. And if undef - bummer request. @mikilskegg What a gygy? Evolution or gnuhello ( gnu.org/software/hello/manual/hello.pdf )? And the evolution is more fun with a programmer on Haskel. - alexlz
Currently widely used for processing large amounts of textual information, which is why it was created. This determines the scope of its popularity. Among other things, it includes such a serious science as bioinformatics - the science of analyzing sequences of nucleic acids and peptides.
Perl is a “powerful, flexible, secure, and modern” high-level language that is used in a wide variety of areas, from parsing textual information to developing graphics and multimedia applications.
It copes with the processing of various types of data, so it is often used when writing various types of parsers and bots. Can be used for system administration tasks.
One of the modern "niches" for the Perl language is web development. It is written a lot of web frameworks - both microformov , and full-featured MVC-frameworks . Many companies develop their Perl engines — domain name recorders and hosting providers, search engines, SEO companies, media companies, online game developers, etc.
In recent years, Perl is experiencing its "renaissance", a kind of rebirth - a lot has been finalized both in the language itself (for example, the most complete Unicode support of all languages ​​appeared) and in third-party modules: frameworks for effective object-oriented writing are written development , asynchronous programming , convenient ORM , and much, much more. As one Perl blog commentator put it recently: "This is not your Daddy's Perl" - "This is not the Perl your daddy was programming on" :) This is Modern Perl .
Perl has a rather active community that supports and develops it. Every year dozens of YAPC (Yet Another Perl Conference) conferences, workshops and technical, as well as non-technical meetings dedicated to Perl are held around the world - often in Russia (often with the participation of foreign guests). Participation in such events is usually free.
By the way, one of such conferences will be held very soon, on May 12-13, in Kiev. If you have time, opportunity and interest in the Perl language, I highly recommend coming to listen to the reports and chat with people using this language in everyday life. Participation in the conference is free, you only need to register and submit an application for participation on the conference website .
- 3"safe and modern"? Yeah ... And the safe - like a machine gun at Popandopulo ("Wedding in Malinovka") - "shoots at its own way"? > With serious development, it has a positive effect on health, increasing adrenaline levels in the blood - alexlz
- 2Responding to all your comments. In my opinion, you have a head crammed with a wrong idea of ​​the language, and you have no idea how programs are written on it. Not one-liner scripts, but software systems with megabytes of code. Every self-respecting company has standards for coding and code design, and ideally peer-to-peer code review, so you simply won't be allowed to write unreadable code in Perl. Perl allows you to write both unreadable and readable programs. The choice is always for the programmer. And if he prefers to write unreadable code - that says a lot about him;) - odmink0
- Yes, I really can not imagine how software systems with megabytes of code are written on it. With hundreds (maybe thousands of thousands) of illiterate code, I saw scripts. The spectacle is not for the faint of heart. Perhaps they write big ones. The question is why? It is possible to chop down trees with a shovel, only the saw / ax is somehow more convenient. - alexlz
- oneSo the fact of the matter is that the pearl is more convenient than anything I personally have not met. Although professionally I use a sufficiently large number of languages ​​(but any deviations from the pearl are for one reason only - the requirement of the customer). - reshu 4:04 pm
Perl gives everything to write elegant and expressive code. Multi-paradigm, modifiable, adaptable to any development model. PS and of course you shouldn’t forget that good perl programmers will always have interesting and well-paid work.
- 2Like any other programmer; D - Zowie
- Well, you, not any, but only the good (and yes, the language is not the main thing here). And at the expense of language power and its variability ... look at the Acme :: * subset ( metacpan.org/search?q=Acme%3A%3A ) metacpan.org/module/Acme::Morse metacpan.org/module/Acme :: Ukrop metacpan.org/module/Acme::Pythonic Acme :: Brainfuck, Acme :: Bleach and more mountains in total. If Perlovik has time to write such strange things, then they have already written everything they need for work. - greenfactory
Perl has been developing very rapidly lately. There were very high-quality web frameworks, such as Mojolicious , Dancer . A completely asynchronous Tatsumaki web framework has appeared , which in performance can compete with Node.js. So for developing web applications, Perl fits perfectly. And if you consider that Perl has one of the best testing systems, then development using TDD (Test Driven Development) becomes one sheer pleasure, and the programs are of very high quality.
Perl is a clever language. It was developed by a linguist by profession. Therefore, Perl is a set of basic building blocks from which to build a beautiful building for your web project. Any finished parts of the building can be found on CPAN or the new METACPAN search engine. This allows you to build a web project building with the highest possible speed.
In general, by choosing a Perl programming language, you definitely win.
- And that the deification of such holy qualities as laziness, pride and impatience, is already in the past. L. Wall changed himself? - alexlz
- oneAll this is implemented in Perl6)) - vaneska
Perl is very laconic, lively, elegant and at the same time CPAN-thermonuclear. It combines different traditions and no condemnation. He gives calm and finds harmony. The rest --- faded shadow and vanity.
- onePearl is very good for one-liners. By increasing the length of the script, its advantages quickly turn into disadvantages. - alexlz
- Without extra entities, you can do this: $ _ = 'World'; say / ^ World $ /? 'Hello': 'Bye', ", $ _!"; # or say qw {Bye Hello} [/ ^ World $ / + 0], ", $ _!"; - DONANGEL
- Now explain to me why it does not work for me? (preferably without leading questions). You can, dear talker? - alexlz
- Straight and want to say after this answer: In saecula saeculorum. - skegg 2:49 pm
- oneI agree, let the respected talker explain. Call the talker! From myself I can add
use feature qw( say );
. - DONANGEL pm
Pearl allows you to focus on the problem, and not on its implementation, works everywhere, never broke backward compatibility and does not intend to. Very good language for newbies: you can write full-fledged working programs from day one and learn new features gradually. Example:
my $name = "World"; if ($name eq 'World') { print "Hello, $name\n"; } else { print "Bye, $name\n"; }
- Most modern languages ​​can do the same. - Specter
- And on the python? name = 'World' if name == 'World': print ('Hello,% s \ n'% name) else: print ('Bye,% s \ n'% name) - alexlz
- onemde ... Example - sadness - Zowie
- And what to show in the example? Regular expressions in conditions: if ($ name = ~ / ^ (World | Something) $ /) {print "Hello, $ 1 \ n"; } Regular expressions as a function: print "Hello,", $ name = ~ / ^ (World | Something) $ /; Arrays, hashes, scalars: my @array = (1, 2, 3); my% hash = (a => 1, b => 2); my $ scalar = 1; - user6901
- Now, this is more interesting, although I’m also implemented in other languages ​​=) - Specter
On perl it is easy and quick to write:
- bot spider.
- processing system of terabytes of text and html.
- window application under linux (qt, gtk).
- web interface (Rose :: DB + HTML :: Template + fastcgi), which will not fall from 1000 simultaneous connections.
- one-liners for everyday tasks (
cat access.log|perl -le 'split,$h{$_[0]}++ for <>; $,="\n"; print map{"$_ $h{$_}"} sort{$h{$a}<=>$h{$b}}keys %h'|tail
) - client for any web and not only service.
- and much more.
- Nothing will happen quickly ... - AseN
- This is my experience, you may not succeed - I did. - smoker
- oneMy experience in this area is also far from being small =) Nevertheless, a quality bot can not be quickly written. If you declare that you can write a bot quickly, then this indicates a low quality of your bots. - AseN
I would rewrite the last example as follows:
my $name = 'World'; my $greet = $name eq 'World' ? 'Hello' : 'Bye'; say $greet . ',' . $name;
And besides word processing, perl is very good for system programming under unix like OS. Various systems for monitoring networks, equipment, etc. are written on it. And in this area it is much more popular than C / C ++, because the speed of development on it is many times faster.
- What is really so modest? my $ name = World; print qw {Hello Bye} [$ name! = World], q {,}, $ name, qq {! \ n}; Anyway - byaka. - alexlz
- 2And what is there unreadable? Just a pearl is such a language. Complicated. To read scripts written on it, you need to know a lot of small things. From the nicked here what: print? operations q, qq, qw? operation
!=
? indexing operation? Everything is quite simple, but hardly anyone unfamiliar with a pearl will be able to read without preparation (and not 5-15 minutes). Language such. (By the way, the terrible conditional operator "?:" Also causes shock to strangers). - alexlz - oneNo, it’s not necessary to say that "perl is such a complex language". It is not true. "perl makes it simple to do simple things, and complex ones makes possible." (c) Larry Wall. - kuptsov
- oneRegarding the statements of Larry. Simple things are simple. It would not be enough for Helovord to occupy several pages. And the fact that complex things are made possible is a very tricky statement. Perhaps it does not mean simply. Everything in the world can be expressed in assembly language, but it does not mean that it is easy to do. Pearl is a very tricky language. It is simple at the level a bit more complicated than the Heloword mentioned. The following is a bunch of all sorts of subtleties and tricks. - skegg
- oneHelovord, speak? Oh well. Look here: ariel.com.au/jokes/The_Evolution_of_a_Programmer.html , section "Master Programmer" You can also see Gnu Hello. Also impressive. - alexlz
Better not start learning Perl, since the demand for Perl programmers fell almost 2 times in the previous year! Exactly the same picture with PHP programmers ... Better start learning Ruby, Ruby on rails or Python + Django. The demand for these programmers has almost doubled! Despite the fact that Perl is quite a powerful and flexible language, it can be studied only for self-development, but not for professional activities, as it gradually dies before our eyes. He is being replaced by completely new solutions.
- one"Exactly the same picture with PHP programmers" - will there be proof? Personally, I have other information. Aha and ruby ​​programmers are in demand: D Although with the fact that Perl dies - I agree - Zowie
- But in the February ranking of programming languages ​​published by Tiobe, perl looked a little up here. So where did the demand fall (and when was it high)? - avp
- Well, once the demand has fallen by half, then it was once twice as high =). In fact, qualified PHP / Perl developers with work experience of 10 years still receive about 150,000 rubles, but the demand for these languages ​​falls every month. For example, demand doubled from September 1, 2011 to December 1, 2011. - AseN
- By the way, based on the list of the popularity of languages ​​you cited, demand for Python fell by almost 4%! I wonder what it can be connected? - AseN