I write Perl scripts that are 10-100 lines of code, and at this size Perl is a Strictly Better Bash: better syntax, some type checking, better text support, and still effortless calls to external processes: essentially you put a command with arguments in backticks, and you get it's output. Ruby can do it too, but not all systems have it. Python is another obvious choice but calling external commands in it is annoying. I also use Perl for some one-liners as a better `sed` for text replacements.
† Perl nowadays have TypeScript-style type checking for function parameters. So, while the syntax is wild sometimes, the language is much better than it used to be.
Minor. Faster unpacking of @_, but it's not a huge win until you have a lot of arguments. The conventional Perl 5 interpreter has no JIT to leverage the benefits of stronger types, inline functions, unroll loops, etc. A factorial function has few arguments, so the unpack gain will be small to nothing.
I can't believe that.
TS code, compile time error "TS2345: Argument of type 'null' is not assignable to parameter of type 'number'."
function foo(x: number): void {};
foo(null);
Perl code: use Kavorka qw(fun);
use Types::Standard qw(Num);
fun foo(Num $x) {}
foo(undef);
This code passes CHECK (perl -c), but should not if you are correct.I invite you to prove the claim. Rewrite this with any module you like.
cperl types worked, and actually made it faster.