You can see the progression of perl from bad to tacked on workarounds. First "local" was added to manually copy values to some stack. Then "my" was added. But all the old problems are still there.
Then there's all the massive mess of $foo vs %foo vs @foo vs &foo. That's super cryptic and leads to really hard to parse code (IMO obviously).
And all the ridiculous cryptic globals https://www.perlmonks.org/?node_id=353259
No thank you
In Perl 6 declaration of any variable is obligatory by default.
> Then there's all the massive mess of $foo vs %foo vs @foo vs &foo
In Perl 6 that has all been made more systematic. Check out https://opensource.com/article/18/9/using-sigils-perl-6 if you want to know how Perl 6 differs from Perl 5 in that respect, and how you can actually have sigilless variables in Perl 6.
> And all the ridiculous cryptic globals
Perl 6 basically only has `$_` (the topic), `$/` (the current match result) and `$!` (the last error) as "cryptic" lexicals. See https://docs.perl6.org/language/5to6-perlvar for a list of Perl 5 variables -> Perl 6 functionality
Also, you can use 'our' to restrict access to a global to a specific scope.
Also, javascript now has 'use strict' (stolen from perl5) which prevents that problem there too.
I fear you have been misinformed about both languages.