Is it still worth learning Perl ?
I don't really care if it's getting me a job or not, I'm thinking about
perl as a practical tool to help me get jobs done. What do you guys think of perl and what is your typical usage of it ? like, when you have a thing to do, what is your criteria for choosing perl over, say, bash, awk, grep, sed and similiar tools ? |
perl knows all of bash, awk, grep and sed (and even more) together. Actually you can do everything with perl, like database access, web server, package management or the nowadays fashionable microservices (amongst other things), just perl itself is out of fashion. So probably better to learn python or java.
The most important feature of perl is the regex which is extremely powerful and used everywhere. It is definitely worth learning those perl regular expressions. |
Down the rabbit hole you go ...
It is not a quick "pick-up-and-run-with-it" scenario although you can pick up the bits you need fairly quickly. But you need to know what you need to know ... :scratch: And of course there is the small matter of which perl. To be honest as a now apparently unemployable has-been, I find my need for perl diminishing toward zero these days. YMMV. |
Quote:
claimed[1] to be one (or many) generations ahead of the competition (including java, nodejs, swift). [1] https://genius.it/25017618/developer...ith-larry-wall |
In fact, Perl 6 has been renamed to Raku ! (try http://perl6.org)
|
It has been called many things since its protracted gestation.
|
If you've written, or are intending to write a bash script that needs to make heavy use of sed/awk or where whitespace or escaping characters becomes an issue then perl5 is probably a better choice.
IMO its niche is in writing small/efficient programs that achieve surprisingly much with a surprising small amount of code: hence why perl5 one liners are such a thing. When using it for small tasks you don't really need to go into that much depth with it, so yes, it's still worth learning the basics, just don't get carried away and try and use it for stuff that it's really not suited for. It's a useful tool for a sysadm to have in his toolkit, but as others have said, it's very much out of fashion these days. |
Quote:
|
Quote:
[1] https://genius.it/25018586/www.evanm...ng-perl-6.html |
I find perl to be my go-to language for any major project. I’ve used it for elaborate, complex data collection and analysis, compilation, formatting and output of the collected data. Got started with an application that collected data about job opportunities, storing it in a “flat file” (‘cause we didn’t know if a database was available), and displaying it on a website.
Since, I mostly use databases, which is not difficult in perl. I use it for “web-based applications”. I use sed pretty much only for one-offs, and I’ve never got around to learning awk at all…never mind java or python (tab formatting? Really? Shades of AS400…) As has been said, grokking perl regex is essential. It is a rabbit hole, but I like it down here. :) |
Quote:
|
I was going to teach myself after retiring, bought the books, then seemed to lose interest; other things took up my time, but if serious, I'll suggest the Perl Mongers forum, they like to encourage newbies, I found, & they have lots of info.
https://www.perlmonks.org/?node_id=739026 |
If you seriously want to use Perl (and I find it my most useful tool after bash) then study Perl-5. Perl-6 is not a language, it is a language standard. Implementations come with different names and degrees of implementation of the standard, but Perl-5 is a very real, and powerful, engine. Learning is never wasted!
Perl one-liners is almost a different animal, and commands that can solve problems with a single line of code on the command line can serve you well in many environments. Plus, they are fun! |
I've used Perl5 for almost all the things mentioned above by others at different times.
Since you say you're not bothered about it getting you a job, I'd say go for it! It's a lot of fun and very powerful and flexible. As above, the gurus live over at perlmonks.org. Docs at https://perldoc.perl.org/ . One of the great things about the docs is the amount of examples used to illustrate every cmd; the opposite of (most) *nix man pages ;) See also https://learn.perl.org/tutorials/. I highly recommend the Learning Perl book (aka Llama book) and the Perl Cookbook . |
I liked and enjoyed perl very much (yes, that was in the previous century). It is really powerful and flexible and efficient and .... No doubt.
An additional link: www.cpan.org which contains the available perl modules (you may try to compare it to python/java modules). And an additional thought: apt, apt-get and the whole package management system was written in pure perl, but now you can find "extensions" written in python. What a mess! |
All times are GMT -5. The time now is 04:13 PM. |