I was very pleased to find a link to a section called "Perl Traps" in the perldocs. It represents a refreshing sense of honesty in an increasingly tech-hyped world.
The https://perldoc.perl.org/perltrap#Perl-Traps link has 9 bullet points. My question is simple--now that it is 2024--which 'Perl Traps' have not been fixed in Raku?
I feel both Perl users and Raku users want a single SO Question to address all 9 bullets, not 9 SO Questions to address each one individually. Even a scorecard and/or fraction (e.g. 7/9, 8/9, 9/9 would be useful. Thanks.
I'm posting this as a community answer because I'm pretty sure it is far from complete.
"Quoting" a couple comments from the reddit thread "When [Raku] was being designed, what alternatives to expanding context sensitivity were considered?":
"[Raku] has nothing like Perl context-sensitivity. Operators don't do different things depending on the surrounding context, and there is no
wantarray. … ." 「1」 ."The sort of context sensitivity that sucked in Perl, eg
wantarray, was eliminated in Raku. The sort of context sensitivity that was already nice in Perl is even nicer in Raku. … ." 「2」 .The latter comment was written by me; for more info about the nicer things see the user doc page about contexts in Raku.
"Quoting" the accepted answer of SO "Rules for barewords":
(Read the answer for details of the two "bare identifier" cases).
All routines can be programmatically inspected via
.signature,.arity, etc.Tools can use that to provide relevant human visual inspection ability too.
All routines in Raku have signatures (which are Raku's vastly improved take on Perl's deeply problematic "prototypes").
The main replacement for the idea of having to remember a list was to make method invocation without an explicit invocant work for any subroutine or method:
One does still have to remember a list, but it's tiny and simple: the matchers (
m//and cousins such ass///andtr///) default to operating on$_.Raku's syntax related to file handle usage is conventional, like mainstream PLs.
Raku replaced
=~with~~(a.k.a. 'smart-match', which--despite its seemingly symmetric appearance--acts asymetrically in Raku).Raku produces suitable error messages if a user attempts to use loop controls where they're not valid.
In Raku to clarify scope you're required to use
myorourin the first instance of a variable declaration 「4」 . Otherwise, Raku pushed 'formats' outside the core language, so Raku doesn't have this Perl anomaly.Raku doesn't have
local()(or globals per se).???