LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-31-2022, 02:10 AM   #1
ychaouche
Member
 
Registered: Mar 2017
Distribution: Mint, Debian, Q4OS, Mageia, KDE Neon
Posts: 369
Blog Entries: 1

Rep: Reputation: 49
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 ?
 
Old 01-31-2022, 02:21 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,041

Rep: Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348
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.
 
1 members found this post helpful.
Old 01-31-2022, 02:55 AM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,153

Rep: Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125
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 ...
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.
 
Old 01-31-2022, 03:05 AM   #4
ychaouche
Member
 
Registered: Mar 2017
Distribution: Mint, Debian, Q4OS, Mageia, KDE Neon
Posts: 369

Original Poster
Blog Entries: 1

Rep: Reputation: 49
Quote:
Originally Posted by syg00 View Post
And of course there is the small matter of which perl.
Exactly. It seems Perl 6 has to be seen as a different (new) programming language,
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
 
Old 01-31-2022, 03:46 AM   #5
ychaouche
Member
 
Registered: Mar 2017
Distribution: Mint, Debian, Q4OS, Mageia, KDE Neon
Posts: 369

Original Poster
Blog Entries: 1

Rep: Reputation: 49
In fact, Perl 6 has been renamed to Raku ! (try http://perl6.org)
 
Old 01-31-2022, 03:52 AM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,153

Rep: Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125
It has been called many things since its protracted gestation.
 
Old 01-31-2022, 03:53 AM   #7
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,918

Rep: Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035
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.
 
1 members found this post helpful.
Old 01-31-2022, 04:38 AM   #8
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,359
Blog Entries: 3

Rep: Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767
Quote:
Originally Posted by pan64 View Post
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.
I got by without sed or awk for years because perl is a superset of those capabilities. If you are doing heavy pattern matching or processing text, then it is unequaled.
 
2 members found this post helpful.
Old 01-31-2022, 07:26 AM   #9
ychaouche
Member
 
Registered: Mar 2017
Distribution: Mint, Debian, Q4OS, Mageia, KDE Neon
Posts: 369

Original Poster
Blog Entries: 1

Rep: Reputation: 49
Quote:
It’s funny, fifteen years ago everyone was saying how Perl was shooting itself in the foot with a massive language redesign, because the world was clearly going to switch to Python and Ruby. Well everyone did switch to Python and Ruby, but now everyone’s got the itch to switch again because it turns out Python and Ruby weren’t designed for concurrent code execution. Maybe shooting yourself in the foot isn’t such a bad strategy, if what you need are bionic robo-feet.
-- Evan Miller[1]

[1] https://genius.it/25018586/www.evanm...ng-perl-6.html
 
Old 01-31-2022, 08:21 AM   #10
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,750

Rep: Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222
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.
 
2 members found this post helpful.
Old 01-31-2022, 08:24 AM   #11
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,753

Rep: Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983
Quote:
Originally Posted by scasey View Post
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.
I'm with you, scasey and Turbocapitalist. It's usually my go-to as well, since it can process files much more quickly than anything else I've used, and DB access is robust as well. Python is handy, too, but perl is more useful (no matter if it's perl or raku. )
 
1 members found this post helpful.
Old 01-31-2022, 10:24 AM   #12
fatmac
LQ Guru
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: Mainly Devuan, antiX, & Void, with Tiny Core, Fatdog, & BSD thrown in.
Posts: 5,521

Rep: Reputation: Disabled
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

Last edited by fatmac; 01-31-2022 at 10:25 AM.
 
2 members found this post helpful.
Old 01-31-2022, 10:54 AM   #13
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS, Manjaro
Posts: 5,767

Rep: Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765
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!
 
Old 01-31-2022, 09:45 PM   #14
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,369

Rep: Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753
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 .
 
1 members found this post helpful.
Old 02-01-2022, 01:05 AM   #15
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,041

Rep: Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348
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!

Last edited by pan64; 02-01-2022 at 01:06 AM.
 
2 members found this post helpful.
  


Reply

Tags
perl



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
I am learning perl. where can I find free web hosting that supports perl. Virtual Circuit Linux - Server 1 11-29-2013 03:53 AM
is perl worth learning? smeezekitty Programming 60 12-26-2009 07:09 PM
perl(Cwd) perl(File::Basename) perl(File::Copy) perl(strict)....What are those? Baldorg Linux - Software 1 11-09-2003 08:09 PM
Finding Module Dependencies...(Still loading...still loading..still loading..HANG!!!) Aeudian Linux - General 3 08-11-2003 03:31 PM
Finding Module Dependencies.....(still loading....Still loading....still loading) Aeudian Linux - Newbie 1 07-28-2003 02:27 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration