in reply to Returning to Perl after almost 3 decades

I'd say the two biggest developments in the language are named parameters on subs, and native try/catch. Or, perhaps, those were the two most deficient absent features in early perl which perl now has. Perl gives you access to the new features various ways, but the best is use v5.40; which gives you a feature-bundle of everything considered stable and not-deprecated as of version 5.40. This includes strict and warnings, so less boilerplate at the top of your scripts.
use v5.40; # strict, warnings, many features use Moo; # lightweight object system use Log::Any '$log'; # my favorite logging system has field1 => ( is => 'rw', required => 1 ); sub method1($self, $z=undef) { try { $self->field1($z) if defined $z; $self->field2($z // 5); } catch ($e) { say $e; $log->error($e); } }

I don't mean to speak ill of the new in-core object system, but if you give it a try you can decide for yourself whether it meets your needs better than Moo.

Oh, and one of my favorites are indented here-docs:

sub foo { my $x= <<~END <-This is the start of the line END }
And for a brief overview of the CPAN landscape, Of course, CPAN is almost infinite, but these are just the ones that I use on a regular basis, and some of their competitors that I know other people like.

Replies are listed 'Best First'.
Re^2: Returning to Perl after almost 3 decades
by DaWolf (Curate) on Aug 15, 2024 at 09:20 UTC
    Thank you so much for such a comprehensive answer!


    Er Galvão Abbott
    www.galvao.eti.br