Perl : ActivePerl vs Strawberry Perl

peterchan75

Supremacy Member
Joined
Apr 26, 2003
Messages
6,735
Reaction score
530
Hi All,

I have been using free activeperl for several years. But the modules in the ppm are often outdated. For example, the Math::Matrix module in ppm is several version behind. I tried strawberry perl on another PC and cpan Math::Matrix gives the latest version. Before I take the plunge, is there any pitfall that I need to look out ?

Thanks in advance.
 

davidktw

Arch-Supremacy Member
Joined
Apr 15, 2010
Messages
13,548
Reaction score
1,302
Hi All,

I have been using free activeperl for several years. But the modules in the ppm are often outdated. For example, the Math::Matrix module in ppm is several version behind. I tried strawberry perl on another PC and cpan Math::Matrix gives the latest version. Before I take the plunge, is there any pitfall that I need to look out ?

Thanks in advance.
If it works, then it should be fine. The interpreter should be similar, just a matter of support and versioning. Apparently if you just search abit online, you will see some mentioned differences.

Personally, I will never recommend Perl on Windows. :)
 

peterchan75

Supremacy Member
Joined
Apr 26, 2003
Messages
6,735
Reaction score
530
If it works, then it should be fine. The interpreter should be similar, just a matter of support and versioning. Apparently if you just search abit online, you will see some mentioned differences.

Personally, I will never recommend Perl on Windows. :)
Hi David,
Is that a dig on Windows? Sometimes I wonder how mindless are they to NOT allow PC with perfectly OK hardware upgrade to Windows 11. Or at least they should continue to provide support(no development but patch security hole) Windows 10 until the user base shrink to an insignificant level. I can't imagine the amount of ewaste their action will generate. The west likes to talk about green. Action speaks louder than word. Is this a bigger dig at Windoze?

Anyway, I will run all the scripts on Strawberry perl and see if there is any hiccup. Will report back.
 

davidktw

Arch-Supremacy Member
Joined
Apr 15, 2010
Messages
13,548
Reaction score
1,302
Hi David,
Is that a dig on Windows? Sometimes I wonder how mindless are they to NOT allow PC with perfectly OK hardware upgrade to Windows 11. Or at least they should continue to provide support(no development but patch security hole) Windows 10 until the user base shrink to an insignificant level. I can't imagine the amount of ewaste their action will generate. The west likes to talk about green. Action speaks louder than word. Is this a bigger dig at Windoze?

Anyway, I will run all the scripts on Strawberry perl and see if there is any hiccup. Will report back.
Windows 10 movement to Windows 11 has its own issue, apparently the criteria to upgrade may not be fixed, just recommendation. That we will need to wait for the final release then we can be certain.

If I have to dig on Microsoft Windows, Perl wouldn’t be the #1 reason. The way how Microsoft does windows force update would be already a goner.

I say why Perl is better on unix system is because that is where it was born in the first place and how tightly integrated it is in the unix environment. If you are concern with the recency of the packages, then unix is where it will be. With the readily available build tool chain, building of perl and its modules upon installation will happen in the most straightforward manner.

:)
 

davidktw

Arch-Supremacy Member
Joined
Apr 15, 2010
Messages
13,548
Reaction score
1,302
Why use Perl instead of Python?
Because Perl is a more expressive language and also has the best regex implementation. It has also being the defacto system script language readily available in unix environment. Perl can be written in concise and terse manner, making it very suitable to mix in a shell script.

Perl is also available as modperl, which currently is still tightly integrated with Apache HTTPd, which makes it an ideal dynamic configuration subsystem as well as a web scripting language.

Here is a seemingly cryptic sample code I wrote as a demonstration to convert from fixed length file input into CSV
Perl:
@_=$_=~/(.{4})(.{8})(.{10})/; s/"/""/g,s/\s*$//,s/^\s*// foreach (@_); print "\"",join("\",\"",@_),"\"\n"

Bash:
$ echo -e "COL1COL2    COL3      \nA\"AABB BB   CCCCCCCCCC" | perl -ne '@_=$_=~/(.{4})(.{8})(.{10})/; s/"/""/g,s/\s*$//,s/^\s*// foreach (@_); print "\"",join("\",\"",@_),"\"\n"'
"COL1","COL2","COL3"
"A""AA","BB BB","CCCCCCCCCC"

I also use one-liner perl a lot in my work, for eg, to allow me parse log files to easily focus in the shell.
Here is a fragment of the httpd access logs
Code:
[02/Aug/2021:14:36:43 +0800] "GET /some_path/ HTTP/1.1" 200 RT=1002ms

If I want to see all web requests that are more than 1s, I may so do in the command line as such
Perl:
tail -f /var/log/httpd/access_log |  perl -ne '/RT=(\d+)ms/; print if ($1 > 1000)'

If you are someone like me whom like programming languages for its constructs and concept, you will like Perl. I am not aware if there is another language that is as "interesting" as Perl. There are a lot of quirks about it, and I like its quirks. Perl is not one important language to me, it's one of the many languages I use in my work. I like to work with an arsenal of tools and mix and match among them. It's very often I use grep, awk, sed, perl, bash , jq, python, and other tools altogether to get a piece of work done. I don't need to find a strong reason to do so, I give myself the freedom to have options. :)

References:
https://blog.usejournal.com/what-is-perl-how-relevant-it-is-and-how-to-get-started-d802e7aba2cdhttps://www.activestate.com/blog/top-10-programming-tasks-that-perl-is-used-for/
 
Last edited:

peterchan75

Supremacy Member
Joined
Apr 26, 2003
Messages
6,735
Reaction score
530
Switching to Strawberry perl is a no brainer. It has most of the modules installed. If not, just cpan.
 

peterchan75

Supremacy Member
Joined
Apr 26, 2003
Messages
6,735
Reaction score
530
Just an update. After upgrading to SSD and reinstalling Windows 10, I revert back to Activeperl 5.20. Tried 5.26 and 5.28, there versions are module mine field. I gave up on them. With, 5.20 I can update to newer module with cpanm if PPM does not have newer modules. PPM will reflect the changes with cpanm. After reinstalling Windows 10, I have problem with Strawberry Perl not associating .pl file with Strawberry Perl icon. I can't double click and run the script.
 

Trader11

Banned
Joined
Oct 14, 2018
Messages
15,697
Reaction score
5,234
A friend introduced perl to me before Python got popular. It's still good enough for my automation script. I am just too lazy to learn new programming language.
Python survived many times....

Remember idiots who said Ruby is gonna replace Python...Look at Ruby nao? It is dying
 

peterchan75

Supremacy Member
Joined
Apr 26, 2003
Messages
6,735
Reaction score
530
Python survived many times....

Remember idiots who said Ruby is gonna replace Python...Look at Ruby nao? It is dying
You are right about python and well intended, but it's just too much for me to recode all my perl script. I have scraper(er.. include Excel VBA for prototype), data cruncher, and serial programmes (modules that execute one after another). I am sure pyhton can do all that but it's too time consuming to relearn and recode. Stepping through old code is another nightmare.
 

Trader11

Banned
Joined
Oct 14, 2018
Messages
15,697
Reaction score
5,234
You are right about python and well intended, but it's just too much for me to recode all my perl script. I have scraper(er.. include Excel VBA for prototype), data cruncher, and serial programmes (modules that execute one after another). I am sure pyhton can do all that but it's too time consuming to relearn and recode. Stepping through old code is another nightmare.
I see. So you are handling legacy code
 
Important Forum Advisory Note
This forum is moderated by volunteer moderators who will react only to members' feedback on posts. Moderators are not employees or representatives of HWZ Forums. Forum members and moderators are responsible for their own posts. Please refer to our Community Guidelines and Standards and Terms and Conditions for more information.
Top